What is PTR?
Pointer record
A PTR (pointer) record is a DNS record that maps an IP address back to a hostname, the reverse of the usual name-to-address lookup.
Reverse DNS reuses the ordinary DNS hierarchy by writing the address backwards under a special domain. For IPv4 the octets are reversed under in-addr.arpa, so the PTR for 192.0.2.1 lives at 1.2.0.192.in-addr.arpa. For IPv6 every hex digit (nibble) of the full address becomes a label under ip6.arpa, which makes the names long but follows the same idea. Reversing puts the most significant part of the address first, so delegation follows address allocation: IANA delegates to the RIRs, the RIRs delegate zones to the organisations holding the address space, and those organisations run nameservers containing a PTR for each address. You can look one up with dig -x 192.0.2.1 or host 192.0.2.1. Delegation naturally happens on octet boundaries in IPv4 (such as a /24) and nibble boundaries in IPv6; smaller IPv4 blocks need a workaround described in RFC 2317, or the ISP sets the records on the customer's behalf.
You see PTR records whenever a tool shows names next to addresses: traceroute hop names, server logs and mail headers. Router hop names often encode the interface, router and city, which makes them useful clues, but a PTR is only a claim by whoever controls the reverse zone. Nothing checks that the name belongs to that address, and records are often stale or missing. Mail servers therefore check FCrDNS: the name's forward lookup must return the same address. Slow reverse lookups also make tools appear slow, which is why -n is useful when troubleshooting. See DNS for the wider system. The Linux Network Connectivity lesson walks the reverse-DNS delegation chain for a real traceroute hop.
Lessons that use PTR
- Linux Network ConnectivityTeaches this term · Beginner · 80 min
Find out why a Linux machine can't reach something, layer by layer: interfaces and addresses, routes and ip route get, ARP and the neighbour table, ping and traceroute, DNS, and listening sockets — with real output from a three-host lab.