How reverse DNS works
Forward DNS maps names to addresses; reverse DNS maps an address back to a name through PTR records in a special tree. For IPv4 the octets are reversed and .in-addr.arpa appended: 192.168.1.10 is looked up as 10.1.168.192.in-addr.arpa. For IPv6 every hex digit of the fully expanded address is reversed and dot-separated under .ip6.arpa, giving 32 labels.
The reverse tree is delegated along the same lines as address allocations: whoever holds 192.168.0.0/16 gets 168.192.in-addr.arpa and can delegate 1.168.192.in-addr.arpa for each /24. In practice that is your ISP or hosting provider; for a single server you usually set the PTR in their control panel rather than running the zone yourself.
Why it matters
- Mail: most receivers reject or spam-folder mail from an address whose PTR is missing or does not match the HELO name (forward-confirmed reverse DNS). This is the main reason people set PTRs.
- Logs and traceroute show hostnames instead of addresses.
- SSH, Kerberos and some firewalls use reverse lookups for access decisions and will time out when the reverse zone is broken.
Smaller than a /24
A /24 is the smallest IPv4 zone that fits the octet boundaries. For a /29 or /28 the provider delegates with the RFC 2317 trick: the parent zone holds CNAMEs for each address pointing into a sub-zone named like 0-7.1.168.192.in-addr.arpa, which the customer controls. The tool names that zone when the prefix is not on an octet boundary. IPv6 has no such problem: /64, /56 and /48 all fall on nibble boundaries.
Questions
What is the PTR record for 8.8.8.8?
It is stored at 8.8.8.8.in-addr.arpa and points to dns.google. Any address’s PTR name is just its octets reversed under in-addr.arpa.
How do I set reverse DNS for my server?
In the hosting provider’s panel (Hetzner: Server → Networking → Reverse DNS; AWS: a support request or Elastic IP settings; most VPS hosts: a field next to the IP). The provider owns the reverse zone, so only they can create the record.
Do I need a PTR for IPv6?
For a mail server, yes, for the same reasons as IPv4. For everything else it is optional but tidy. The ip6.arpa name is long, which is why this tool generates it for you.
What should the PTR point to?
A name that resolves back to the same address (the forward record must exist). For mail servers it should match the server’s HELO/EHLO name, e.g. mail.example.com.