DNS for IPv6 clients and servers
Separate DNS record type (A, AAAA) from DNS transport (IPv4, IPv6) and test both with dig. Explain how hosts learn DNS servers from RDNSS and DHCPv6 and which source wins. Configure Unbound and BIND to serve over IPv6, including AAAA glue for IPv6-reachable name servers. Diagnose common dual-stack DNS failures, including broken AAAA records and large responses.
Take the quiz · pass mark 70% · 9 questions
Explanation
DNS problems are the most common reason users say "IPv6 broke the Internet". Usually IPv6 itself works, but a record, a resolver or a firewall is wrong, and the failure shows up as slowness or errors only for some names. This lesson covers DNS from the host's side and the server's side.
Record type is not transport
Two separate questions are often confused:
- What is asked for: an A record (IPv4 address) or an AAAA record (IPv6 address, RR type 28, defined in RFC 3596 together with
ip6.arpareverse names). - How the query travels: over IPv4 or over IPv6.
Any combination works. A host with only IPv4 transport to its resolver can still look up AAAA records, and an IPv6-only host can look up A records. dig lets you control both:
dig -6 @2001:db8:3000:f00::53 www.lab.example AAAA # AAAA over IPv6
dig -4 @192.0.2.53 www.lab.example AAAA # AAAA over IPv4
dig -6 +trace www.lab.example AAAA # follow the delegation chain over IPv6
A dual-stack client normally sends A and AAAA queries in parallel, then orders the results with RFC 6724 (L3.04) and connects with Happy Eyeballs (RFC 8305): it waits up to 50 ms for the AAAA answer after the A answer arrives, starts with IPv6, and starts IPv4 if IPv6 has not connected within about 250 ms.
How hosts learn DNS servers
| Source | Mechanism | Notes |
|---|---|---|
| RA | RDNSS (servers) and DNSSL (search list), RFC 8106 | Works with SLAAC only; the only option for Android |
| DHCPv6 | OPTION_DNS_SERVERS (23) and OPTION_DOMAIN_LIST (24), RFC 3646, carried by RFC 9915 | Stateless (O flag) or stateful (M flag) |
| Manual | Static configuration | Servers and appliances |
| DNR | Encrypted DNS resolver discovery (DoT/DoH), RFC 9463, in RAs or DHCPv6 | Newer; support is growing |
RFC 8106 says a host that learns DNS from both RAs and DHCPv6 should keep servers from both (at least three in total), with DHCPv6 information taking precedence. A sensible design puts the same servers in both, so it does not matter which source a client uses.
Use global or ULA addresses for DNS servers, not link-local ones: link-local servers need a zone index and many resolvers handle that badly.
On Linux, check what the host really uses with resolvectl status (systemd-resolved) or /etc/resolv.conf. On Windows use Get-DnsClientServerAddress -AddressFamily IPv6, and on macOS scutil --dns.
Resolvers and authoritative servers over IPv6
Unbound (recursive resolver):
server:
interface: 0.0.0.0
interface: ::0
do-ip6: yes
access-control: 2001:db8:3000::/44 allow
access-control: 192.0.2.0/24 allow
prefer-ip6: no
BIND (authoritative):
options {
listen-on { any; };
listen-on-v6 { any; };
recursion no;
};
zone "lab.example" { type primary; file "/etc/bind/db.lab.example"; };
Recent BIND 9 releases already listen on IPv6 by default, but stating it explicitly makes the intent clear. Older configuration examples use master instead of primary.
For an authoritative server to be reachable over IPv6:
- The server must listen on IPv6 and the firewall must allow UDP and TCP port 53.
- Its NS name needs an AAAA record.
- If the NS name is inside the zone it serves (for example
ns1.lab.exampleforlab.example), the parent zone needs AAAA glue, registered at the registrar or parent operator. Without glue, IPv6-only resolvers cannot reach it.
Common dual-stack DNS failures
| Symptom | Cause |
|---|---|
| A site is slow or fails only for IPv6 users | AAAA record points to an address where the service does not listen, or IPv6 path is broken. Happy Eyeballs hides it for some clients but not all |
| Names resolve over IPv4 but time out over IPv6 | Resolver not listening on IPv6, ACL missing the IPv6 client range, or firewall blocking UDP/TCP 53 over IPv6 |
| IPv6-only resolvers cannot resolve a zone | No AAAA or AAAA glue for its name servers |
| Large answers (DNSSEC, many records) fail intermittently | Fragmented UDP responses dropped by firewalls; TCP 53 blocked |
| Hosts use an unexpected resolver | Different servers in RDNSS and DHCPv6, or a rogue RA advertising RDNSS |
Large responses and fragmentation. IPv6 routers never fragment, and many firewalls drop fragments. RFC 9715 recommends that DNS over UDP avoid fragmentation: responders and requestors should limit the UDP payload to the path or interface MTU and to at most 1400 bytes, and fall back to TCP when an answer is truncated. The 2020 DNS Flag Day proposed 1232 bytes, the IPv6 minimum MTU of 1280 minus 48 bytes of IPv6 and UDP headers. Unbound and BIND use 1232 as the default EDNS buffer size in current releases. TCP port 53 must always be open.
Do not filter AAAA records to "fix" broken IPv6. It hides the real fault and breaks IPv6-only clients. Fix the path or the record.
ictNetworks scenario
ictNetworks runs anycast recursive resolvers on loopbacks in its infrastructure block, 3fff:a00::53 and 3fff:a00::54. They are advertised in RDNSS by the residential CPEs and BNGs, in DHCPv6 option 23 for business customers, and configured statically on VPSs. The authoritative servers for customer reverse zones (L2.07) have AAAA glue in the parent zones.
Drawing diagram…
Worked examples
Example 1: The 1232-byte buffer
The IPv6 minimum link MTU is 1280 bytes. Subtract the IPv6 header (40) and the UDP header (8): 1280 − 40 − 8 = 1232 bytes of DNS payload, which always fits without fragmentation.
Example 2: A 1500-byte path
On a path with MTU 1500, the largest unfragmented DNS payload over IPv6 is 1500 − 48 = 1452 bytes. RFC 9715 still caps the recommended size at 1400, so a responder following it uses 1400.
Example 3: Which DNS server wins?
A host gets RDNSS 2001:db8:3000:f00::53 from the RA and DHCPv6 option 23 2001:db8:3000:f00::54. Under RFC 8106 it should keep both, with the DHCPv6 server first. Both servers serve the same data in a good design, so the order does not matter.
Example 4: Missing glue
lab.example is served by ns1.lab.example (2001:db8:3000:f00::53, 192.0.2.53). The parent zone has only an A glue record. IPv4-capable resolvers work. A resolver with only IPv6 transport cannot reach ns1 and fails to resolve anything in lab.example. Adding the AAAA glue at the parent fixes it.
Lab
Goal: Run a resolver and an authoritative server over IPv6, test record type and transport separately, and break and fix glue.
You need: Containers or namespaces: auth (BIND, authoritative for lab.example and a child zone sub.lab.example), res (Unbound), and a client. Addresses from 2001:db8:3000:f00::/64 and 192.0.2.0/24.
Step 1: Authoritative server
Create lab.example with SOA, NS ns1.lab.example, A and AAAA for ns1 and for www (2001:db8:f000::80, 203.0.113.80). Check the zone with named-checkzone and query it with dig -6 and dig -4 directly.
Step 2: Resolver
Configure Unbound with a stub or forward zone for lab.example pointing at auth. Query AAAA and A records for www over both transports. Show one AAAA query over IPv4 and one A query over IPv6.
Step 3: IPv6-only recursion and glue
Delegate sub.lab.example to ns2.sub.lab.example on a second BIND instance, with only an A glue record in the parent. Set do-ip4: no in Unbound and try to resolve www.sub.lab.example. Record the failure, add the AAAA glue, reload, and show it working.
Step 4: Large responses
Add 30 AAAA records to one name. Query with dig +bufsize=1232 and +bufsize=4096, and with +notcp and +tcp. Record when the answer is truncated (TC flag) and how the client recovers.
What to submit
Configurations, zone files, dig outputs with explanations for each step, and a short note on what you would check first when a customer reports "IPv6 DNS is slow".
Summary
- AAAA (RFC 3596) is a record type, not a transport. Test with
dig -6anddig -4separately. - Hosts learn DNS from RDNSS (RFC 8106), DHCPv6 options 23 and 24 (RFC 3646), statically, or via DNR (RFC 9463). DHCPv6 takes precedence, so advertise the same servers in both.
- Authoritative servers need IPv6 listening, AAAA records for their NS names, and AAAA glue where the NS name is in-zone.
- Avoid fragmented DNS: RFC 9715 recommends at most 1400 bytes; 1232 is the common default. Keep TCP 53 open.
- Do not filter AAAA records; fix the broken path or record.
- Next lesson (L3.08): troubleshooting hosts and LANs.
Quiz imported · 9 questions · pass mark 70%. Lab questions are not auto-marked.