Resource Records for Reverse-Name Resolution
Forward resolution returns an IP address for a specified domain name. Reverse-name resolution returns a domain name for a specified IP address. DNS implements reverse-name resolution by using the special in-addr.arpa
and ip6.arpa
domains for IPv4 and IPv6.
The characteristics for a zone's in-addr.arpa
or ip6.arpa
domains are usually defined in /etc/named.conf
, for example:
zone "2.168.192.in-addr.arpa" IN {
type master;
file "reverse-192.168.2";
allow-update { key “rndc-key”; };
notify yes;
};
The zone's name consists of in-addr.arpa
, preceded by the network portion of the IP address for the domain, with its dotted quads written in reverse order.
If the network doesn't have a prefix length that's a multiple of 8, see RFC 2317 for the format that you need to use instead.
The PTR
records in in-addr.arpa
or ip6.arpa
domains define host names that correspond to the host part of the IP address. The following example is take from the /var/named/reverse-192.168.2
zone file:
$TTL 86400 ;
@ IN SOA dns.us.example.com. root.us.example.com. (
57 ;
28800 ;
7200 ;
2419200 ;
86400 ;
)
IN NS dns.us.example.com.
1 IN PTR dns.us.example.com.
1 IN PTR us.example.com.
2 IN PTR svr01.us.example.com.
101 IN PTR host01.us.example.com.
102 IN PTR host02.us.example.com.
103 IN PTR host03.us.example.com.
...
For more information, see the BIND 9 Administrator Reference Manual.