Reverse DNS lookup is the process of querying the Domain Name System (DNS) for a domain name associated with an IP address. Whereas a forward DNS lookup commonly translates a name into an address using an A or AAAA record, a reverse lookup usually retrieves a PTR record from a specially organized DNS namespace. Reverse DNS supports network diagnostics, readable logs, and some email filtering practices, but does not by itself establish a host’s identity or trustworthiness.
Naming and record structure
Reverse DNS does not search all forward DNS records for names containing a particular address. Instead, it uses a separate hierarchy in which an address is encoded as a DNS name:
- IPv4 addresses use the
in-addr.arpadomain. - IPv6 addresses use the
ip6.arpadomain.
A PTR record, short for pointer record, associates a name in this hierarchy with a target domain name. The address components are reversed because DNS delegation proceeds from right to left, while network addresses are conventionally written with their most significant components first. Reversing the address places the broader network prefix nearer the root of the reverse namespace.
Forward and reverse mappings are maintained independently. Creating an A or AAAA record does not automatically create a PTR record, and creating a PTR record does not automatically create a corresponding forward record. Management software may coordinate them, but DNS itself does not enforce that coordination.
IPv4
For an IPv4 address, the four decimal octets are reversed and followed by in-addr.arpa. For example, the reverse lookup name for 192.0.2.25 is:
25.2.0.192.in-addr.arpa.
An illustrative record is:
25.2.0.192.in-addr.arpa. 3600 IN PTR mail.example.com.
Here, 3600 is the record’s time to live in seconds, IN identifies the Internet class, and mail.example.com. is the target name. The trailing dot marks an absolute domain name.
The address and domain in this example are reserved for documentation.
IPv6
For an IPv6 address, the full 128-bit address is expanded into 32 hexadecimal digits. Each digit represents four bits, or a nibble. The digits are reversed, separated by dots, and followed by ip6.arpa.
For example, 2001:db8::1 expands to:
20010db8000000000000000000000001
Its reverse lookup name is:
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
Each hexadecimal digit is a separate DNS label. This structure supports delegation at four-bit boundaries.
How resolution works
An application typically asks a DNS resolver to perform the lookup. The resolver constructs the appropriate reverse name and requests its PTR records. If a suitable answer is not cached, resolution follows DNS referrals through the reverse hierarchy until an authoritative server supplies an answer or reports that the requested data does not exist.
The result can include:
- One PTR record naming the address.
- Multiple PTR records naming the same address.
- An indication that the queried name does not exist, commonly reported as
NXDOMAIN. - A successful DNS response containing no PTR records for an existing name, often called a NODATA result.
- A temporary failure, such as a timeout, unreachable server, or server error.
These outcomes are not equivalent. Missing reverse data does not mean that an address is unreachable, and a DNS timeout does not establish that no PTR record exists.
DNS caching applies to reverse lookups as it does to forward lookups. Positive answers remain cached according to their time to live; negative answers can also be cached. Consequently, changes may not become visible to every client immediately.
Applications may use an operating system name-resolution interface rather than directly issuing a DNS query. Such interfaces can consult local configuration or other naming services, so a displayed address-to-name result is not always evidence of a public DNS PTR record.
Administration and delegation
Reverse DNS is normally controlled through the organization responsible for an address allocation, such as an Internet service provider, hosting company, or network operator. This differs from forward DNS, which is controlled through the delegation of a domain name.
For example, control of example.com permits its administrator to publish an A record pointing to a server’s address, but does not necessarily permit that administrator to change the address’s PTR record. The address provider may offer a control panel, an API, a support process, or delegation of a reverse zone.
Classless IPv4 delegation
The IPv4 reverse hierarchy naturally aligns with octet boundaries. A zone such as 2.0.192.in-addr.arpa corresponds to the addresses in 192.0.2.0/24. Allocations smaller than this do not fit directly into the same label structure.
RFC 2317 describes a widely used classless delegation method: the parent reverse zone publishes CNAME aliases that redirect individual reverse names into a separately delegated zone. This allows the recipient of a smaller address block to manage its PTR records without administering the entire parent zone.
The method complements Classless Inter-Domain Routing rather than changing how ordinary PTR queries are made.
Private and local addressing
Private address spaces can have reverse records within an organization’s own DNS infrastructure. Because these addresses are reused across unrelated networks, their reverse data is not a globally unique public directory.
Internal resolvers may serve local reverse zones, and DNS standards specify locally served zones for several special-use address ranges. Split DNS configurations can therefore return different answers depending on the querying client’s network or resolver.
Uses
Network diagnostics and logging
Diagnostic programs such as traceroute can display reverse-resolved names alongside addresses. Administratively chosen names may indicate a device’s role, provider, or location. Such information is descriptive rather than authoritative: naming conventions can be incomplete or outdated.
Servers and monitoring systems may also resolve addresses to make logs easier to interpret. Because DNS resolution introduces latency and possible failures, some systems retain numeric addresses and perform name resolution separately.
Email handling
Receiving email servers often examine the reverse DNS of a connecting mail server as one input to spam and abuse controls. Some also test whether the returned name resolves forward to the connecting address.
Missing or inconsistent reverse DNS can affect acceptance under a recipient’s local policy. However, a valid PTR record does not establish that a message is legitimate, that its claimed sender is authorized, or that its contents are safe. Reverse DNS is distinct from email authentication mechanisms such as SPF, DKIM, and DMARC.
Operational identification
Reverse names can help operators distinguish servers, identify infrastructure, and investigate traffic. An address shared by many websites or users may nevertheless have only a provider-assigned reverse name. Reverse DNS is therefore not a complete inventory of the services using an address.
Forward-confirmed reverse DNS
Forward-confirmed reverse DNS (FCrDNS) checks consistency between reverse and forward mappings:
- Query the address’s PTR records.
- Resolve a returned name using A records for IPv4 or AAAA records for IPv6.
- Check whether the resulting address set includes the original address.
If a name passes this test, its reverse and forward records agree for that address. Implementations can differ in how they handle multiple PTR records or partial failures.
FCrDNS provides a stronger consistency check than a PTR lookup alone, but is not a substitute for authentication. An operator controlling both an address’s reverse mapping and a domain’s forward records can configure a matching pair without establishing any broader claim about identity or reputation.
Limitations and security
Reverse DNS is not a mathematical inverse of forward DNS. Many names can resolve to one address, a name can resolve to multiple addresses, and an address can have no PTR record or several. Neither hierarchy is required to enumerate the other completely.
Important limitations include:
- Untrusted labels: PTR targets are assertions made by the reverse-zone administrator. A target name alone does not demonstrate control of the named domain.
- Stale data: Address reassignment or configuration changes can leave outdated records.
- Availability dependencies: Synchronous reverse lookups can delay applications when DNS is slow or unavailable.
- Information exposure: Descriptive names can reveal internal conventions or infrastructure roles.
- Weak access-control evidence: Hostname-based authorization can be unsafe if it treats reverse names as verified identities.
DNS Security Extensions can authenticate signed DNS data and protect against certain forms of DNS forgery. They do not establish that a PTR target accurately describes a machine, that an operator is trustworthy, or that forward and reverse records agree.
Tools and standards
Common command-line tools include:
dig -x 192.0.2.25
nslookup 192.0.2.25
host 192.0.2.25
The -x option tells dig to construct the reverse lookup name. A PTR query can also be issued explicitly:
dig PTR 25.2.0.192.in-addr.arpa.
The modern DNS framework and IPv4 reverse namespace are described in RFC 1034 and RFC 1035, published in 1987. IPv6 reverse naming under ip6.arpa is specified in RFC 3596. The older IPv6 reverse domain ip6.int was deprecated by RFC 4159.
Ordinary reverse DNS should not be confused with the historical DNS inverse query operation, or IQUERY. IQUERY was a separate protocol operation, later made obsolete by RFC 3425; modern reverse lookups use normal DNS queries directed at the reverse namespace.