Reverse DNS and PTR records
The short version
- A reverse lookup starts with an IP address and asks for a name.
- It uses a PTR record. PTR is short for "pointer".
- The address is written backwards and ends in
in-addr.arpa. - Many addresses have no PTR record at all. That's allowed.
- A domain's own DNS zone doesn't hold PTR records for your server's address. They live in a separate tree.
Going from a number to a name
Most of this guide goes one way. You have a name, like mail.example.com. DNS gives you an address.
Reverse DNS goes the other way. You have an address, like 192.0.2.25. You want a name. The process uses PTR records.[1]
Why the address is written backwards
DNS can only look up a name. So an address has to become a name first.
The Internet has a special branch of the tree for this, called IN-ADDR.ARPA. The four numbers of the address are reversed and put in front of it. In the standard's own example, address 10.2.0.52 is found at 52.0.2.10.IN-ADDR.ARPA.[2]
The same thing for our example address looks like this:
Why reverse it? The standard says the reversal allows zones to be delegated that are exactly one network of address space.[2] If the idea of handing over a zone is new, see zones and zone files.
A PTR lookup in practice
The dig tool has a shortcut for this. The -x option sets up a simplified reverse lookup, for mapping addresses to names.[3] There's a bit more on it in dig and nslookup.
$ dig -x 192.0.2.25
dig flips the address and asks for a PTR record at 25.2.0.192.in-addr.arpa. If the owner has set one up, the answer is a hostname such as mail.example.com.
IPv6 does it too
IPv6 addresses work the same way, with a different branch. It's rooted at IP6.ARPA.[4]
The address is split into single hex digits. They are written in reverse order, lowest digit first, with dots between them.[4] That makes the names long. Tools like dig -x build them for you.
Matching forward and reverse
The two directions are separate records, kept in separate places. Nothing forces them to agree.
One old guide to common DNS mistakes says to make sure your PTR and A records match.[5] It also says a PTR record must point back to a real A record, not to an alias made with a CNAME.[5]
For example, 192.0.2.25 might have a PTR record that gives mail.example.com. Then mail.example.com should have an A record that gives 192.0.2.25 back.
When there's no answer
Don't panic if a reverse lookup finds nothing. That guide recommends a PTR record for every address, but it isn't a requirement of the Internet standards. Not all IP addresses have a reverse entry.[1]
Some addresses have more than one PTR record. That's allowed too.[1]
The reverse tree is organised by address, not by domain name.[2] So the PTR record for an address sits in the reverse zone for that address range, not in your domain's zone. If you want one for your server, ask whoever gave you the address.
Sources
- Reverse DNS lookup, Wikipedia (accessed 2026-11-03)
- RFC 1035: Domain names - implementation and specification, IETF (accessed 2026-11-03)
- BIND 9 manual pages: dig, Internet Systems Consortium (BIND 9 documentation) (accessed 2026-11-03)
- RFC 3596: DNS Extensions to Support IP Version 6, IETF (accessed 2026-11-03)
- RFC 1912: Common DNS Operational and Configuration Errors, IETF (accessed 2026-11-03)