Reverse DNS (PTR records): from IP address to name

What reverse DNS is, how PTR records work for IPv4 and IPv6, why mail servers need them, and who can change them.

Normal DNS turns a name into an IP address. Reverse DNS does the opposite: it turns an IP address back into a name. It is used by mail servers to judge senders, by log files and traceroute to show readable host names, and by network administrators to see what an address belongs to.

How reverse DNS works

Reverse lookups use ordinary DNS with a trick. The IP address is rewritten as a name in a special zone, and a PTR record on that name holds the host name.

For IPv4, the four parts of the address are reversed and in-addr.arpa is added. The address 203.0.113.25 becomes:

25.113.0.203.in-addr.arpa.  PTR  mail.example.com.

The order is reversed because DNS names are read from right to left, while IP addresses are allocated from left to right. Reversing them means that the owner of a whole block (say, 203.0.113.0/24) can be delegated the zone 113.0.203.in-addr.arpa.

For IPv6, the zone is ip6.arpa, and every single hexadecimal digit of the fully written-out address is reversed and separated by dots. 2001:db8::25 turns into a name with 32 labels ending in 8.b.d.0.1.0.0.2.ip6.arpa. Enter any address on webstriker and the report shows the reverse name for you.

Who controls a PTR record?

This is the most important practical point: reverse DNS belongs to whoever owns the IP address, not whoever owns the domain. The reverse zones are delegated by the regional internet registries (RIPE NCC in Europe, ARIN in North America, and so on) to the organisations that hold the address blocks – usually your hosting company, ISP or cloud provider.

So you cannot set the PTR record for your server in your own domain's DNS. Instead you set it in your hosting provider's control panel (many VPS and cloud providers have a "reverse DNS" field next to each IP address), or you ask the provider's support to do it. On a home connection, the ISP sets a generic name, and you usually cannot change it.

Advertisement

Forward-confirmed reverse DNS

Anyone who controls an IP address can put any name in its PTR record – including a name they do not own. To guard against that, receivers check that it works both ways: the PTR name must have an A or AAAA record that points back to the same IP address. This is called forward-confirmed reverse DNS (FCrDNS).

When you look up an IP address on webstriker, the "Forward confirmation" list shows exactly this check: the PTR name, the addresses it resolves to, and whether the original address is among them.

Why mail servers need reverse DNS

Almost every large email provider checks the reverse DNS of the server that connects to deliver mail. A sending mail server should have:

Missing or generic reverse DNS is one of the most common reasons why mail from a self-hosted server is rejected or lands in spam. The webstriker domain report shows the PTR name of every MX server's address in the Email section. The PTR of the server that sends your mail is what matters for deliverability, so if you send through another server than your MX, look up its IP address directly.

Other uses

Key takeaways

Try it yourself:
Advertisement

More guides