Reverse DNS and ip6.arpa
Build the nibble-format ip6.arpa name for any IPv6 address and the zone name for any nibble-aligned prefix. Delegate reverse zones on nibble boundaries, including non-nibble prefixes that need several zones. Compare the ISP approaches to reverse DNS for customer prefixes described in RFC 8501. Run an authoritative reverse zone and delegate part of it to another name server.
Take the quiz · pass mark 70% · 10 questions
Explanation
Reverse DNS maps an address back to a name. It appears in traceroutes, server logs, mail server checks and many troubleshooting tools. IPv6 reverse DNS works the same way as IPv4 in principle, but its size changes how ISPs and hosting providers run it.
The ip6.arpa name (RFC 3596)
RFC 3596 (section 2.5) defines the reverse name of an IPv6 address:
- Write the address in full: all 32 hex digits, no
::, no leading-zero suppression. - Reverse the order of the digits (nibbles), so the lowest-order digit comes first.
- Separate every digit with a dot and append
ip6.arpa.
For 2001:db8:4a00:10::25:
full form 2001:0db8:4a00:0010:0000:0000:0000:0025
digits 2 0 0 1 0 d b 8 4 a 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 5
reversed 5.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.0.a.4.8.b.d.0.1.0.0.2.ip6.arpa
Every PTR name has exactly 32 nibble labels before ip6.arpa. Typing them by hand is error-prone. Use dig -x 2001:db8:4a00:10::25, which builds the name for you, or Python's ipaddress.IPv6Address(...).reverse_pointer.
Zones follow nibbles
Each nibble is one DNS label, so a zone cut can only fall on a nibble boundary. The zone for a prefix of length n (a multiple of 4) is named by the first n/4 digits, reversed:
| Prefix | Labels | Zone name |
|---|---|---|
2001:db8::/32 | 8 | 8.b.d.0.1.0.0.2.ip6.arpa |
2001:db8:3000::/48 | 12 | 0.0.0.3.8.b.d.0.1.0.0.2.ip6.arpa |
2001:db8:3000:ab00::/56 | 14 | b.a.0.0.0.3.8.b.d.0.1.0.0.2.ip6.arpa |
2001:db8:3000:ab00::/64 | 16 | 0.0.b.a.0.0.0.3.8.b.d.0.1.0.0.2.ip6.arpa |
Non-nibble prefixes need several zones, one for each nibble-aligned prefix that covers it at the next longer nibble boundary. A /50 needs 2^(52 − 50) = 4 zones (four /52s). A /58 needs 4 zones (four /60s). This is a strong reason to keep customer assignments on nibble boundaries (L2.01, L2.04). IPv4 used RFC 2317 CNAME tricks for classless delegation. In IPv6 you avoid the problem by planning.
Drawing diagram…
Why IPv4 habits do not work
In IPv4, ISPs often pre-populate one PTR record for every address, for example host-203-0-113-25.example.net. A single IPv6 /64 has 2^64 addresses, so this is impossible. RFC 8501 analyses the alternatives for ISPs (RFC 4472 had already discussed wildcards and dynamic updates for IPv6 reverse DNS):
| Approach | How it works | Pros | Cons |
|---|---|---|---|
| Negative response | Return NXDOMAIN for customer addresses | Accurate, nothing to run | Forward and reverse do not match (RFC 1912 expects them to). Some services wait for or dislike the result, but mail servers rejecting such hosts may be desirable. |
| Wildcard | One wildcard PTR per customer prefix | Scales well | Every address returns the same name, so forward lookups cannot match |
| Dynamic DNS | Hosts or CPEs update PTR (and AAAA) records | Accurate when it works | No standard way to tell devices where to send updates, plus security and scaling concerns |
| Delegate | Delegate the customer's /48 or /56 to the customer's name servers | Most accurate. The customer controls their names. | Most homes have no name server. Never delegate to a name server that does not exist. |
| On-the-fly generation | The authoritative server synthesises a PTR (and matching AAAA) from the queried address | Forward and reverse match, nothing to store | Needs software support (for example Knot DNS's synthrecord module or PowerDNS scripting). The names may reveal that an address is in use. |
RFC 8501's guidance: where address assignment and name are under the same authority, or a host has a static address and name, AAAA and PTR should exist and match. For residential users, ISPs choose between wildcard or generated responses and a negative answer, depending on which uses of PTR they care about (mail filtering, logs, traceroute and so on).
What this means for the ictNetworks scenario
- Infrastructure (
3fff:a00::/48): real PTR records for every loopback and link address, because traceroutes through the network should be readable. For example3fff:a00:0:1025::b→r2-link37.example.net. - Hosting: each VPS customer gets a control-panel feature that sets the PTR for addresses in their routed /64, or a delegation of their /64 zone if they run DNS. Mail servers in particular need a matching PTR, because many receivers check that forward and reverse agree.
- Business customers (/48): delegation on request, otherwise generated records.
- Residential (/56): generated records or NXDOMAIN, never delegation to a CPE that is not a name server.
Operating tips
- PTR lookups go to the zone for the most specific delegation. Check the delegation chain with
dig +trace -x <address>. - Keep reverse zones in your IPAM-driven automation (L2.08). Stale PTRs after renumbering are a common mistake.
- DNSSEC-signing a reverse zone works as for any other zone. Wildcards and on-the-fly generation need care (RFC 8501 discusses this).
Worked examples
Example 1: PTR name
2001:db8:4a00:10::25 → 5.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.0.a.4.8.b.d.0.1.0.0.2.ip6.arpa.
Example 2: Zone name for a /48
2001:db8:3000::/48 has 12 digits 2001 0db8 3000. Reversed: 0.0.0.3.8.b.d.0.1.0.0.2.ip6.arpa.
Example 3: Delegating a /56
The /56 2001:db8:3000:ab00::/56 adds the digits a b. Its zone is b.a.0.0.0.3.8.b.d.0.1.0.0.2.ip6.arpa. In the /48's zone file (origin 0.0.0.3.8.b.d.0.1.0.0.2.ip6.arpa.), the delegation is written relative to the origin:
b.a 3600 IN NS ns1.dept.example.net.
b.a 3600 IN NS ns2.dept.example.net.
Example 4: A non-nibble customer prefix
A customer has 2001:db8:4a00:4000::/50. The next nibble boundary is /52, so you delegate 4 zones: the /52s starting 4000, 5000, 6000 and 7000. Their zone names start 4.0.0.a.4…, 5.0.0.a.4…, 6.0.0.a.4… and 7.0.0.a.4….
Example 5: Reading a PTR name back
b.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.2.0.1.0.0.0.0.0.0.a.0.f.f.f.3.ip6.arpa reversed is 3fff 0a00 0000 1025 0000 0000 0000 000b, which is 3fff:a00:0:1025::b: the B side of link 37 in the scenario (L2.05).
Example 6: A record inside a zone
In the zone for 2001:db8:3000::/48, the PTR for 2001:db8:3000:10::25 uses the remaining 20 digits, reversed, as a relative owner name:
5.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0 3600 IN PTR printer-hq.example.net.
Lab
Goal: Build the reverse zone for 2001:db8:3000::/48 (site 0 of your L2.04 plan), delegate a /56 to a second name server, and verify both with dig.
You need: Docker, and BIND 9 (internetsystemsconsortium/bind9 image) or Knot DNS (cznic/knot image). Names use the reserved example domains of RFC 2606.
Step 1: Generate the zone
Write mkrev.py that reads your L2.04 plan CSV (or a small list of addresses and names) and writes a zone file for 0.0.0.3.8.b.d.0.1.0.0.2.ip6.arpa with an SOA, two NS records, and a PTR for each loopback, link address and server. Use ipaddress.IPv6Address(x).reverse_pointer and strip the zone suffix to make relative owner names.
Step 2: Run the parent server
Start the first container (ns-parent) as the authoritative server for the /48 zone. Load the zone and run named-checkzone (BIND) or kzonecheck (Knot) before you start the server.
Step 3: Delegate a /56
Choose 2001:db8:3000:ab00::/56 as the department's block. Start a second container (ns-dept) that is authoritative for b.a.0.0.0.3.8.b.d.0.1.0.0.2.ip6.arpa and holds a PTR for 2001:db8:3000:ab00::53. Add the NS records for b.a to the parent zone. Because the name servers' own names live outside the reverse zone, you need no glue records here. Point both NS names at the containers in a small forward zone or with /etc/hosts in your test client.
Step 4: Verify
dig @<ns-parent> -x 2001:db8:3000:10::25 +short
dig @<ns-parent> -x 2001:db8:3000:ab00::53 # expect a referral (authority section: NS for b.a...)
dig @<ns-dept> -x 2001:db8:3000:ab00::53 +short
Step 5: On-the-fly (optional)
With Knot DNS, enable the synthrecord module for the department zone so that any address without an explicit PTR gets a generated name. Show that a forward lookup of the generated name returns the same address, if you also configure the forward side.
What to submit
mkrev.py, both zone files, the check command output, and the three dig outputs with a sentence explaining the referral.
Summary
- An ip6.arpa name is the 32 hex digits of the full address in reverse order, dot-separated, plus
ip6.arpa(RFC 3596). - Zones cut on nibble boundaries. A /n zone has n/4 labels. Non-nibble prefixes need 2^(next nibble − n) zones, so keep assignments nibble-aligned.
- Pre-populating every PTR is impossible in IPv6. RFC 8501 compares NXDOMAIN, wildcards, dynamic DNS, delegation and on-the-fly generation. Static hosts and infrastructure should have matching AAAA and PTR records.
- In the scenario: real PTRs for infrastructure, customer-controlled PTRs for VPSs, delegation for businesses that ask, and generated or negative answers for homes.
- Next lesson (L2.08): keeping track of all of this in IPAM, and getting ready to renumber.
Quiz imported · 10 questions · pass mark 70%. Lab questions are not auto-marked.