{"id":1728,"date":"2011-01-30T13:20:24","date_gmt":"2011-01-30T12:20:24","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?p=1728"},"modified":"2012-08-30T13:22:25","modified_gmt":"2012-08-30T12:22:25","slug":"dns-pointer-record-ptr","status":"publish","type":"post","link":"http:\/\/darenmatthews.com\/blog\/?p=1728","title":{"rendered":"DNS &#8211; Pointer Record (PTR)"},"content":{"rendered":"<p><strong>Pointer Record (PTR)<\/strong><\/p>\n<p>Pointer records are the opposite of A and AAAA RRs and are used in Reverse Map zone files to map an IP address (IPv4 or IPv6) to a host name.<!--more--><br \/>\n<strong>Format<\/strong><\/p>\n<p><code>name ttl\u00a0 class\u00a0\u00a0 rr\u00a0\u00a0\u00a0\u00a0 name<br \/>\n15\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN\u00a0\u00a0\u00a0\u00a0 PTR\u00a0\u00a0\u00a0 www.example.com.<\/code><\/p>\n<p>The number &#8217;15&#8217; (the base IP address) in the above example is actually a name and because there is no &#8216;dot&#8217; BIND adds the $ORIGIN. The example below which defines a reverse map zone file for the Class C address 192.168.23.0 should make this clearer:<\/p>\n<p><code>$TTL 2d ; 172800 secs<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 \/>\n12h\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 ; minimum<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 \/>\n; 2 below is actually an unqualified name and becomes<br \/>\n; 2.23.168.192.IN-ADDR.ARPA.<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. ; FDQN<br \/>\n....<br \/>\n15\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.<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 \/>\nBecause the $ORIGIN reflects the reverse map domain all right-hand names must use an FQDN format (they end with a dot). If the terminating dot on joe.example.com above were omitted in error it would become joe.example.com.23.168.192.IN-ADDR.ARPA &#8211; not the desired result!.<\/p>\n<p>An IP address in a reverse can be defined only once &#8211; unlike a forward-mapped zone. If multiple names are assigned to a host using CNAME RRs, A RRs or AAAA RRs then only one can appear in the reverse map. Which one you select is a matter of operational usage. Thus if a mail server (mail.example.com) and a web server (www.example.com) both have the same IP address then since mail systems frequently use reverse lookups as a trivial security check it would be sensible to define the reverse map to use mail.example.com.<\/p>\n<p>It is not essential, but considered good practise, to define all assigned IPs in the reverse map.<\/p>\n<p>It is sensible to define the reverse map in order of IP addresses or some other fixed order to avoid subsequent errors or to simplify searching for a particular value.<\/p>\n<p><a href=\"http:\/\/www.zytrax.com\/books\">source of information<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pointer Record (PTR) Pointer records are the opposite of A and AAAA RRs and are used in Reverse Map zone files to map an IP address (IPv4 or IPv6) to a host name.<\/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\/1728"}],"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=1728"}],"version-history":[{"count":1,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1728\/revisions"}],"predecessor-version":[{"id":1729,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1728\/revisions\/1729"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1728"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}