Reverse DNS zones
Get the PTR name for an IP address and the reverse DNS zones for a network, including RFC 2317 delegation for blocks smaller than a /24. Add hostnames to get a zone file.
PTR name
192.0.2.25Example: type your own address above.
Reverse zone
192.0.2.0/24No network entered, so this uses the /24 around the address. Enter your network to match your delegation.
Zone file
2.0.192.in-addr.arpa$ORIGIN 2.0.192.in-addr.arpa.
$TTL 3600
; Placeholder SOA and NS: replace ns1.example.com, ns2.example.com and
; hostmaster.example.com with your own name servers and contact address.
@ IN SOA ns1.example.com. hostmaster.example.com. (
1 ; serial: raise it on every change
3600 ; refresh
900 ; retry
1209600 ; expire
3600 ) ; negative-answer TTL
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
; Add one PTR record per address, for example:
; 10 IN PTR mail.example.com.
How it works
Reverse DNS turns an IP address back into a name. The name lives in a PTR record under a special domain: in-addr.arpa for IPv4, with the address's bytes reversed, and ip6.arpa for IPv6, with each hex digit reversed. So the PTR for 192.0.2.25 is at 25.2.0.192.in-addr.arpa.
Zones split only on dots, so IPv4 zones come in /8, /16 and /24 sizes and IPv6 zones every 4 bits. A /22 needs four /24 zones. Blocks smaller than a /24 can't have a zone of their own, so RFC 2317 uses a trick: the owner of the /24 adds a CNAME for each of your addresses, pointing into a zone you run, like 64-127.113.0.203.in-addr.arpa. Most hosting providers set this up when you ask.
For email senders: receiving mail servers look up the PTR of the IP that connects to them. Gmail, Microsoft and others expect a PTR that exists, that points to a name which resolves back to the same IP, and that matches the name your server gives in its HELO greeting (like mail.example.com). Without it, much of your mail is rejected or lands in spam. Check yours with the PTR check. To see which range an address belongs to, use the subnet calculator.