{"id":1724,"date":"2011-01-30T13:13:43","date_gmt":"2011-01-30T12:13:43","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?p=1724"},"modified":"2012-08-30T13:24:28","modified_gmt":"2012-08-30T12:24:28","slug":"dns-in-addr-arpa-reverse-mapping","status":"publish","type":"post","link":"http:\/\/darenmatthews.com\/blog\/?p=1724","title":{"rendered":"DNS &#8211; IN-ADDR.ARPA Reverse Mapping"},"content":{"rendered":"<p><strong>IPv4 IN-ADDR.ARPA Reverse Mapping Domain<\/strong><br \/>\nWe defined the normal domain name structure as a tree starting from the root. We write a normal domain name LEFT to RIGHT but the hierarchical structure is RIGHT to LEFT.<\/p>\n<p><code>domain name = www.example.com<br \/>\nhighest node in tree is = .com<br \/>\nnext (lower) = .example<br \/>\nnext (lower) = www<\/code><!--more--><\/p>\n<p>An IPv4 address is written as:<\/p>\n<p>192.168.23.17<\/p>\n<p>This IPv4 address defines a host (17) which happens to be in a Class C address range (192.168.23.x). In this case the most important part (the highest node) is on the LEFT (192) not the RIGHT. This is a tad awkward and would make it impossible to construct a sensible tree structure that could be searched in a single lifetime.<\/p>\n<p>The solution is to reverse the order of the address and place the result under the special domain IN-ADDR.ARPA (you will see this also written as in-addr.arpa which is perfectly legitimate since domain names are case insensitive but the case should be preserved between query and response, so we will continue to use IN-ADDR.ARPA. You may elect to use whatever you wish including IN-addr.Arpa if that is your preference).<\/p>\n<p>Finally the last part of the IPv4 Address (17) is the host address and hosts, from our previous reading, are typically defined inside a zone file so we will ignore it and only use the Class C address base. The result of our manipulations are:<\/p>\n<p>IP address =192.168.23.17<br \/>\nClass C base = 192.168.23 ; omits the host address = 17<br \/>\nReversed Class C base = 23.168.192<br \/>\nAdded to IN-ADDR.ARPA domain = 23.168.192.IN-ADDR.ARPA<\/p>\n<p>This is show in the figure here:<br \/>\n<a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2012\/08\/IN-ADDR.ARPA-Reverse-Mapping.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1725\" title=\"IN-ADDR.ARPA Reverse Mapping\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2012\/08\/IN-ADDR.ARPA-Reverse-Mapping.jpg\" alt=\"IN-ADDR.ARPA Reverse Mapping\" width=\"527\" height=\"164\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2012\/08\/IN-ADDR.ARPA-Reverse-Mapping.jpg 527w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2012\/08\/IN-ADDR.ARPA-Reverse-Mapping-300x93.jpg 300w\" sizes=\"(max-width: 527px) 100vw, 527px\" \/><\/a><br \/>\narpa organization<\/p>\n<p><strong>IN-ADDR.ARPA Reverse Mapping<\/strong><br \/>\nFinally we construct a zone file to describe all the hosts (nodes) in the Reverse Mapped zone using PTR Records ( see <a href=\"http:\/\/darenmatthews.com\/blog\/?p=1728\">this post<\/a> for more about PTR records ). The resulting file will look something like this:<\/p>\n<p><code>$TTL 2d\u00a0 ; 172800 seconds<br \/>\n$ORIGIN 23.168.192.IN-ADDR.ARPA.<br \/>\n@\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN\u00a0\u00a0\u00a0\u00a0\u00a0 SOA\u00a0\u00a0 ns1.example.com. hostmaster.example.com. (<br \/>\n2003080800 ; serial number<br \/>\n3h\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; refresh<br \/>\n15m\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; update retry<br \/>\n3w\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; expiry<br \/>\n3h\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; nx = nxdomain ttl<br \/>\n)<br \/>\nIN\u00a0\u00a0\u00a0\u00a0\u00a0 NS\u00a0\u00a0\u00a0\u00a0\u00a0 ns1.example.com.<br \/>\nIN\u00a0\u00a0\u00a0\u00a0\u00a0 NS\u00a0\u00a0\u00a0\u00a0\u00a0 ns2.example.com.<br \/>\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN\u00a0\u00a0\u00a0\u00a0\u00a0 PTR\u00a0\u00a0\u00a0\u00a0 www.example.com. ; qualified name<br \/>\n2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN\u00a0\u00a0\u00a0\u00a0\u00a0 PTR\u00a0\u00a0\u00a0\u00a0 joe.example.com.<br \/>\n.....<br \/>\n17\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN\u00a0\u00a0\u00a0\u00a0\u00a0 PTR\u00a0\u00a0\u00a0\u00a0 bill.example.com.<br \/>\n.....<br \/>\n74\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN\u00a0\u00a0\u00a0\u00a0\u00a0 PTR\u00a0\u00a0\u00a0\u00a0 fred.example.com.<br \/>\n....<br \/>\n<\/code><br \/>\nWe must use qualified names ending with a dot (in fact they are Fully Qualified Domain Names &#8211; FQDNs) in reverse mapped zone files because if we did not our $ORIGIN directive would lead to some strange results. For example, if we wrote an unqualified name such as:<br \/>\n<code><br \/>\n74\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN\u00a0\u00a0\u00a0\u00a0\u00a0 PTR fred<\/code><\/p>\n<p>Using the $ORIGIN substitution rule the above would expand to fred.23.168.192.IN-ADDR.ARPA. which is probably not what we intended.<\/p>\n<p><a href=\"http:\/\/www.zytrax.com\/books\">source of information<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>IPv4 IN-ADDR.ARPA Reverse Mapping Domain We defined the normal domain name structure as a tree starting from the root. We write a normal domain name LEFT to RIGHT but the hierarchical structure is RIGHT to LEFT. domain name = www.example.com highest node in tree is = .com next (lower) = .example next (lower) = www<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[87,84],"tags":[],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1724"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1724"}],"version-history":[{"count":3,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1724\/revisions"}],"predecessor-version":[{"id":1730,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1724\/revisions\/1730"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1724"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}