Reverse directory

Reverse lookup name builder

A phone book's reverse directory starts from the number and finds the name. DNS does the same with PTR records, but it first turns the address into a name it can look up. Type an address below to see that name.

Look up a number

Address and host name

Plain address, optionally followed by a prefix such as /24 or /64 (to list candidate reverse zones for that network too). IPv6 may be in square brackets and may end in a % zone index, such as [fe80::1%eth0]/64.

A fully qualified ASCII host name, with or without the final dot. The builder adds no domain, so nas alone is not accepted.

The rules it uses

IPv4 RFC 1035, section 3.5

a.b.c.d d.c.b.a.in-addr.arpa.

Each label is one octet written in decimal, with leading zeros left out. The order is reversed so that the most specific part comes first, which lets a network's reverse names sit in one zone: 192.168.50.0/24 lives in 50.168.192.in-addr.arpa.

IPv6 RFC 3596, section 2.5

2001:db8::53 32 hex digits, reversed one digit at a time, dot between each, then ip6.arpa.

The address is first written out in full (every :: expanded and every group padded to four digits, using the text forms in RFC 4291, section 2.2). Each hex digit stands for 4 bits, so a /64 network's zone is the first 16 digits reversed.

Zones 8-bit and 4-bit boundaries, estimates

A reverse zone name can only end on a whole label: every 8 bits for IPv4, every 4 bits for IPv6. Where a zone is really cut depends on how it was delegated, so the zones shown are candidates and estimates. The query name above is different: it is computed exactly from the text you typed.

prefix p, label width s = 8 (IPv4) or 4 (IPv6)
aligned (p is a multiple of s): reverse the first p / s labels
otherwise: b = s × ceil(p / s), count = 2^(b − p). Round the boundary label (number b / s) down to a multiple of count. The candidates are the count names that reverse the first b / s labels, with that label running from the rounded value up to the rounded value + count − 1. The one larger candidate keeps floor(p / s) labels.

Example: 192.168.63.200/20 gives the query name 200.63.168.192.in-addr.arpa.. Here b = 24 and count = 16, so the boundary label 63 rounds down to 48 and the sixteen candidate zones run from 48.168.192.in-addr.arpa. to 63.168.192.in-addr.arpa., inside the larger candidate 168.192.in-addr.arpa..

IPv4 blocks smaller than a /24 are the exception. They have no zone of their own in the usual setup, so the builder shows the /24 as the conventional parent. With classless delegation (RFC 2317, section 4) the /24 zone holds a CNAME for each address that points into a child zone, and the PTR record goes at that CNAME target, whose name depends on the delegation. The PTR line the builder prints is a direct-placement example: it fits a zone that owns the query name itself. A /32 is one host, so its query name is a name inside the parent /24 zone, not a zone.

dig -x sends a PTR query and shows the reply your resolver is configured to give, if any. It checks the configured reply, not the zone layout.

What it assumes

  • The result is plain text built from what you type. Nothing is looked up, sent or stored.
  • Address input. One IPv4 address (four numbers from 0 to 255, no leading zeros) or one IPv6 address, then an optional /prefix. Square brackets are accepted only as a pair around an IPv6 address, as in [2001:db8::53]/64 (RFC 4291, sections 2.2 and 2.3). An IPv4 prefix runs from 0 to 32 (RFC 4632, section 3.1) and an IPv6 prefix from 0 to 128.
  • Zone index. An IPv6 % zone index such as %eth0 must not be empty. It only means something on your own machine (RFC 4007, section 11, and RFC 9844), so it is kept in the notes but left out of the lookup name. A % on an IPv4 address is rejected.
  • Example scenarios. Without a prefix it shows candidate zones for a /24 (IPv4) or a /64 and /48 (IPv6) network. Those are common sizes used as examples, not a guess about your network. The IPv4 example button uses 192.168.50.10, a private address (RFC 1918, section 3). The IPv6 example uses 2001:db8::/32, the documentation prefix (RFC 3849).
  • Host name. The PTR record line needs a fully qualified ASCII host name such as nas.home.arpa, with or without the final dot. The builder adds no domain: a name typed as nas would be the absolute name nas. under the root, so it is not accepted. Labels use letters, digits and hyphens, up to 63 characters each, and the whole name is at most 253 characters (RFC 1035, section 3.1). home.arpa. (RFC 8375) is shown as the example because it is reserved for home networks.
  • The PTR record line uses standard zone-file syntax with a trailing dot. Your DNS server's own screens may ask for the same parts in separate boxes.

Sources

  1. RFC 1035: Domain names - implementation and specification, section 3.5 (IN-ADDR.ARPA domain)IETF, 1987
  2. RFC 3596: DNS Extensions to Support IP Version 6, section 2.5 (IP6.ARPA domain)IETF, 2003
  3. RFC 4291: IP Version 6 Addressing Architecture, sections 2.2 and 2.3 (text forms of addresses and prefixes)IETF, 2006
  4. RFC 4632: Classless Inter-domain Routing (CIDR), section 3.1 (IPv4 prefix lengths)IETF, 2006
  5. RFC 1918: Address Allocation for Private Internets, section 3 (private address space, including 192.168.0.0/16)IETF, 1996
  6. RFC 4007: IPv6 Scoped Address Architecture, section 11 (textual representation, the % zone index)IETF, 2005
  7. RFC 9844: Entering IPv6 Zone Identifiers in User Interfaces (updates RFC 4007)IETF, 2025
  8. RFC 2317: Classless IN-ADDR.ARPA delegation, section 4IETF, 1998
  9. RFC 8375: Special-Use Domain 'home.arpa.'IETF, 2018
  10. RFC 3849: IPv6 Address Prefix Reserved for DocumentationIETF, 2004
  11. dig - DNS lookup utility (BIND 9 manual pages)Internet Systems Consortium