Generate the reverse DNS (PTR) lookup format for an IPv4 or IPv6 address.
Reverse DNS maps an IP address to a hostname using PTR records in the .in-addr.arpa domain. The IPv4 address octets are reversed (since DNS hierarchy reads right-to-left but IP addresses read left-to-right) and appended with .in-addr.arpa to form the lookup name.
PTR record format
PTR = D.C.B.A.in-addr.arpa for IP A.B.C.D
DNS is hierarchical from right to left (e.g. .com > example.com > www.example.com) while IP addresses are hierarchical from left to right. Reversing the octets aligns IP hierarchy with DNS hierarchy, allowing delegated zone management per octet boundary.
PTR records map IP addresses to hostnames — used by email servers for sender verification (SPF/DKIM), by log analysis tools for readable names, and by security tools for identifying devices by hostname from captured IP addresses.