How do I set up a reverse zone file?
Using the addresses you have in the zone file above, 1.2.3.4 and 101.102.103.104 there are two PTR records you will be concerned with - 4.3.2.1.in-addr.arpa and 104.103.102.101.in-addr.arpa.
IF you are delegated management of the reverse zones 3.2.1.in-addr.arpa and 103.102.101.in-addr.arpa zones you can declare them in your named.conf file, e.g.:
zone "3.2.1.in-addr.arpa" in {
type master;
file "3.2.1.rev";
};
and create zone files and populate them with PTR records, e.g.:
$TTL 2d ; 172800 seconds
$ORIGIN 3.2.1.IN-ADDR.ARPA.
@ IN SOA ns1.example.com. hostmaster.example.com. (
2013010304 ; serial number
3h ; refresh
15m ; update retry
3w ; expiry
3h ; nx = nxdomain ttl
)
IN NS ns1.example.com.
IN NS ns2.example.com.
4 IN PTR mysite.net.
; etc
The problem is that as the other replies have said, unless you are delegated authority for the reverse zones by whoever has been assigned your address block by ARIN (or whichever regional internet registry controls assignments for your region) you can have your name server publish any zones you want but nobody will ever find them by following a delegation chain from the root.
Thus it's important that you understand who should be publishing the records, whether it's your responsibility or someone else's.
Reverse DNS lookups for IPv4 use a reversed IP address (to work within the hierarchical structure of DNS) in the zone in-addr.arpa
.
So to provide answers to queries against, for instance, 192.0.2.0
, a DNS server should answer for 0.2.0.192.in-addr.arpa
.
However, it's unlikely that your hosting company has delegated to your server for that address, since the smallest normal DNS parent domain that your address is in is a /24
.
You may be able to contact your host and get them to delegate the /32
address to your DNS server via the method in RFC 2317, but it's simpler and more likely to be supported by your host to just have them set the record to what you want it to be.