Reverse DNS lookup: how PTR records turn an IP address into a name

By TechCompare · Updated · How we check

A reverse lookup asks for the PTR record at a name built from the IP address. Only whoever holds the address can set it, and mail servers trust it only when that name points back to the same address.

A normal DNS lookup goes from a name to an address. A reverse lookup goes the other way: it starts with an IP address and finds the name that belongs to it. DNS has no index of addresses, so the address gets turned into a special name, and the answer sits in a PTR record there.

Topic
Reverse DNS (PTR)
Addresses to names
Category
Record types
What each record does

How this is calculated

For IPv4, the four numbers are written backward under in-addr.arpa, so 192.0.2.10 becomes 10.2.0.192.in-addr.arpa. The order flips because DNS names get more specific to the left, while IP addresses get more specific to the right. For IPv6, every hex digit of the full address is written backward under ip6.arpa (RFC 3596). That makes a name with 32 digits, one per label.

The reverse zone belongs to whoever holds the address block, not to the owner of a domain. Regional registries like ARIN and RIPE NCC hand reverse zones to the networks they give addresses to, and those pass control on to their customers, or keep it. So you can't add a PTR record at your domain's DNS host. You set it at your hosting, cloud or internet provider, often in a reverse DNS field next to the server's IP address.

A PTR record on its own proves little, since the address holder can type in any name, including yours. That's why mail servers check both ways. They read the PTR name, look up that name's A or AAAA records, and expect the same address back. This is called forward confirmed reverse DNS. Gmail requires it of every sender, and a server that fails it gets error 550 5.7.25, which says the IP has no PTR record or its name doesn't point back.

Private addresses, like 192.168.x.x and 10.x.x.x (RFC 1918), have no names in public DNS, so public resolvers answer NXDOMAIN for them. Only the DNS server on that network, like a router or an Active Directory server, can know their names.

Type an IP address into the DNS Lookup and it asks for the PTR record, then looks up each name it finds to see if it points back. Try 8.8.8.8: its PTR record is dns.google, and dns.google points back to 8.8.8.8.

Verdict

If you run a mail server, set its PTR record at your provider to a name you control, then give that name an A or AAAA record with the same address. Check both directions before you send any mail. For a web server, reverse DNS is optional, but a clear name still helps anyone reading logs or a traceroute.

More DNS scenarios

TXT records
The free text record that holds verification codes, SPF, DKIM keys and DMARC policies.
View details
SPF vs DKIM vs DMARC
SPF checks the sending server, DKIM checks the message, and DMARC ties both to the From address.
View details
MX records
How senders find your mail servers, what the priority number does, and the null MX for domains that take no mail.
View details

Frequently asked questions

Why can't I add a PTR record at my DNS host?
Your DNS host runs the zone for your domain, and PTR records live in the reverse zone for the IP address, which belongs to whoever holds that address. Ask your hosting or cloud provider. Most have a reverse DNS setting for each address, and some want a support ticket.
Does every IP address have a reverse DNS name?
No. Many addresses have none, and the lookup returns NXDOMAIN or an empty answer. Private addresses never have one in public DNS. Servers that send mail should always have one, since Gmail and other receivers check it.
Is reverse DNS the same as a reverse IP lookup?
Not quite. Reverse DNS reads the PTR record, the one name the address holder picked. A reverse IP lookup usually means listing every domain hosted on an address, which DNS can't answer. Those tools build their lists from huge databases of forward lookups.