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
Reverse lookup name (PTR query)
Address order
Lookup name order (reversed)
The query name is computed from the text you typed, by the rules below. The zones are estimates: where a reverse zone is really cut depends on how it was delegated, so read them as candidates. dig -x sends a PTR query and shows the reply your resolver is configured to give, if any. It does not show how the zones are laid out, and a missing record is not an error in the name.
The rules it uses
- IPv4 RFC 1035, section 3.5
-
a.b.c.dd.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/24lives in50.168.192.in-addr.arpa. - IPv6 RFC 3596, section 2.5
-
2001:db8::5332 hex digits, reversed one digit at a time, dot between each, thenip6.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/64network'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 widths= 8 (IPv4) or 4 (IPv6)
aligned (pis a multiple ofs): reverse the firstp / slabels
otherwise:b = s × ceil(p / s),count = 2^(b − p). Round the boundary label (numberb / s) down to a multiple ofcount. The candidates are thecountnames that reverse the firstb / slabels, with that label running from the rounded value up to the rounded value +count − 1. The one larger candidate keepsfloor(p / s)labels.Example:
192.168.63.200/20gives the query name200.63.168.192.in-addr.arpa.. Hereb= 24 andcount= 16, so the boundary label 63 rounds down to 48 and the sixteen candidate zones run from48.168.192.in-addr.arpa.to63.168.192.in-addr.arpa., inside the larger candidate168.192.in-addr.arpa..IPv4 blocks smaller than a
/24are the exception. They have no zone of their own in the usual setup, so the builder shows the/24as the conventional parent. With classless delegation (RFC 2317, section 4) the/24zone 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/32is one host, so its query name is a name inside the parent/24zone, not a zone.dig -xsends 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%eth0must 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/64and/48(IPv6) network. Those are common sizes used as examples, not a guess about your network. The IPv4 example button uses192.168.50.10, a private address (RFC 1918, section 3). The IPv6 example uses2001: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 asnaswould be the absolute namenas.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
- RFC 1035: Domain names - implementation and specification, section 3.5 (IN-ADDR.ARPA domain)IETF, 1987
- RFC 3596: DNS Extensions to Support IP Version 6, section 2.5 (IP6.ARPA domain)IETF, 2003
- RFC 4291: IP Version 6 Addressing Architecture, sections 2.2 and 2.3 (text forms of addresses and prefixes)IETF, 2006
- RFC 4632: Classless Inter-domain Routing (CIDR), section 3.1 (IPv4 prefix lengths)IETF, 2006
- RFC 1918: Address Allocation for Private Internets, section 3 (private address space, including 192.168.0.0/16)IETF, 1996
- RFC 4007: IPv6 Scoped Address Architecture, section 11 (textual representation, the % zone index)IETF, 2005
- RFC 9844: Entering IPv6 Zone Identifiers in User Interfaces (updates RFC 4007)IETF, 2025
- RFC 2317: Classless IN-ADDR.ARPA delegation, section 4IETF, 1998
- RFC 8375: Special-Use Domain 'home.arpa.'IETF, 2018
- RFC 3849: IPv6 Address Prefix Reserved for DocumentationIETF, 2004
- dig - DNS lookup utility (BIND 9 manual pages)Internet Systems Consortium