Chapter 2. DNS Changes

Ideally you are using domain names instead of IPv6 addresses, but to do so, you need to ensure that your application is retrieving the correct information from the Domain Name System (DNS).

In IPv4, the DNS record pointing a hostname www to an IP address is an A record and would look like this in a DNS zone file:

www 3600 A 198.51.100.22

With IPv6, the new DNS record is the AAAA (also known as a “quad A”) record, as in this example:

www 3600 AAAA 2001:db8:12af::53

Ultimately, we will get to a point where DNS zone files contain both an A and an AAAA record for a host name. For example:

www 3600 A 198.51.100.22
www 3600 AAAA 2001:db8:12af::53

Today, some operational issues (see below) have prevented widespread deployment of both A and AAAA records for the same host name, but this is the direction in which DNS records will go.

Handling AAAA Records

The first question is obviously whether your application can correctly handle AAAA records. When you issue a request for a hostname, does the underlying library even return AAAA records?

If your app does get an AAAA record back, what does it do with the AAAA record? Does it use the record to correctly obtain the IPv6 address for the hostname? Or does your app ignore the returned AAAA record and only look for A records?

Warning

It is incredibly important to realize that AAAA records can be retrieved over IPv4. In other words, just because you can retrieve a DNS AAAA record does not mean you can connect to that site using IPv6.

Get Migrating Applications to IPv6 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.