I have an IP address; what is the hostname related to it?
When the user enters the domain name in its browser search bar, a DNS lookup process is performed that linked the domain name with its host IP address.
The Reverse IP Lookup is the opposite of DNS lookup. It starts with a known IP address and ends with finding the domain or hostname associated with it.
DNS PTR record is the reverse of both A record for IPv4 address and an AAAA record for IPv6 address, referred to as "forward DNS" records.
Its structure is the same as other types of DNS records. However, one thing is essential; it's reverse mapping. Therefore, the IP address is specified in the reverse sequence.
In IPv4
For example, the PTR record for the domain DNS.google with IPv4 address 8.8.4.4 will be stored in the following way.
Name | TTL | Class | Type | rdata |
---|---|---|---|---|
4.4.8.8.in-addr.arpa. | 3600 | IN | PTR | dns.google |
Here, a PTR record stored as the IP address is broken down into segments and then reversed, followed by .in-addr.arpa.
In IPv6
For example, the PTR record for the domain DNS.google with IPv6 address 2001:4860:4860::8844 will be stored in the following way.
Name | TTL | Class | Type | rdata |
---|---|---|---|---|
4.4.8.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.8.4.0.6.8.4.1.0.0.2.ip6.arpa. | 3600 | IN | PTR | dns.google |
Here, a PTR record stored as the IP address is reversed and then broken down into four-bit sections, followed by .ip6.arpa.
RFC 1912 section 2.1 states that every Internet-reachable host should have a name and make sure your PTR and A records match.