Reverse DNS and PTR record
Reverse DNS looks up a domain name associated with an IP address. A PTR record stores that reverse mapping in a special part of DNS. It is often used by mail systems and network tools to display or check a name for an address, but a PTR result does not prove who owns the address or that a website is trustworthy.
How does a PTR lookup work?
For IPv4, the four numbers in the address are reversed under in-addr.arpa. For example, the reverse lookup name for 192.0.2.25 is 25.2.0.192.in-addr.arpa. A PTR record at that name can point to a host name such as mail.example.com. IPv6 uses a different reverse tree under ip6.arpa, with the address represented as individual hexadecimal digits (using digits and the letters a to f) in reverse order.
The organization controlling the relevant address block usually controls which servers are responsible for reverse DNS. That organization may be the network provider rather than the domain owner. The name returned by a PTR lookup is just DNS data; it can be missing, inaccurate, or point to a name that does not resolve back to the same address.
Is reverse DNS the opposite of an A record?
It is a related lookup in the opposite direction, but the records are configured independently. An A record maps a name to an IPv4 address; a PTR record maps the reverse address name to a host name. DNS does not require these mappings to match automatically.
Related terms
- IP address — the address being reversed
- DNS record — general record context
- Network operator and ASN — may control which servers answer reverse lookups
- Mail server — often uses reverse-DNS names