How to Add an IPv6 Address to DNS

Adding IPv6 addresses to DNS is a critical step in modernizing your network infrastructure. This comprehensive guide covers everything you need to know about configuring IPv6 DNS records across multiple platforms, from popular DNS providers to manual BIND configurations.

Understanding IPv6 DNS Records

IPv6 uses AAAA records (quad-A records) to map domain names to IPv6 addresses, just as A records map domains to IPv4 addresses. An AAAA record contains a 128-bit IPv6 address in colon-separated hexadecimal format, such as 2001:0db8:85a3:0000:0000:8a2e:0370:7334 or its compressed form 2001:db8:85a3::8a2e:370:7334.

For dual-stack environments (supporting both IPv4 and IPv6), you'll typically configure both A and AAAA records pointing to the same hostname. This ensures maximum compatibility across all networks.

Adding AAAA Records in Cloudflare

Cloudflare makes it straightforward to add IPv6 support to your domain:

Step-by-Step Instructions

  1. Log into Cloudflare Dashboard: Navigate to your domain's DNS settings
  2. Click "Add record": Find the button to create a new DNS entry
  3. Configure the AAAA record:
    • Type: Select "AAAA" from the dropdown
    • Name: Enter your hostname
      • Use @ for the root domain (example.com)
      • Use www for www.example.com
      • Use any subdomain name (e.g., api, blog, mail)
    • IPv6 Address: Enter your full IPv6 address (e.g., 2606:4700::6811:b055)
    • TTL: Set Time to Live (Auto is recommended for proxied records)
    • Proxy status: Choose orange cloud (proxied) or gray cloud (DNS only)
  4. Save the record

Cloudflare-Specific Notes

Example Configuration

Type: AAAA
Name: www
IPv6 Address: 2001:db8::567:89ab
TTL: Auto
Proxy: Enabled

Adding AAAA Records in AWS Route 53

AWS Route 53 provides robust IPv6 support for both standard and alias records:

Basic AAAA Record Creation

  1. Open Route 53 Console: Navigate to your hosted zone
  2. Create Record Set: Click "Create Record"
  3. Configure the record:
    • Record name: Enter subdomain or leave blank for root
    • Record type: Select "AAAA - IPv6 address"
    • Value: Enter your IPv6 address in standard notation
    • TTL: Set your desired Time to Live (default: 300 seconds)
    • Routing policy: Choose Simple, Weighted, Latency, etc.

Alias Records for AWS Services

For AWS services (CloudFront, ELB, S3), create alias AAAA records:

  1. Enable Alias: Toggle the alias option
  2. Select Target: Choose your AWS resource (CloudFront distribution, Load Balancer, etc.)
  3. Routing Policy: Configure as needed

Route 53 Best Practices

Example Zone File Format

example.com.    300 IN AAAA 2001:db8:cafe:f9::d3
www.example.com. 300 IN AAAA 2001:db8:cafe:f9::d4

BIND Configuration

For organizations running their own DNS servers with BIND9, IPv6 configuration is straightforward:

Basic Zone File Syntax

Add AAAA records to your zone file using this format:

$ORIGIN example.com.
$TTL 2d

; IPv6 records
@       IN  AAAA    2001:db8::1
www     IN  AAAA    2001:db8::2
mail    IN  AAAA    2001:db8::3
ftp     IN  AAAA    2001:db8::4

Dual-Stack Configuration

For hosts with both IPv4 and IPv6, attach both record types:

; Dual-stack server
server      IN  A       192.0.2.10
            IN  AAAA    2001:db8::10

; Dual-stack website
www         IN  A       192.0.2.20
            IN  AAAA    2001:db8::20

Advanced Configurations

Round-Robin Load Balancing:

web     IN  AAAA    2001:db8::5
        IN  AAAA    2001:db8::6
        IN  AAAA    2001:db8::7

Custom TTL Values:

cdn     3600    IN  AAAA    2001:db8::8

Multiple Mail Servers:

mail    IN  AAAA    2001:db8::32
mail    IN  AAAA    2001:db8::33
mail    IN  AAAA    2001:db8::34

Important BIND Notes

IPv6 Reverse DNS (PTR Records)

Reverse DNS is crucial for email delivery, security, and network diagnostics. IPv6 reverse DNS uses the ip6.arpa zone.

Understanding IPv6 Reverse DNS

IPv6 reverse DNS requires converting the address into a specific format:

  1. Expand the IPv6 address: Remove all compression and write out all zeros
  2. Reverse nibbles: Take each hexadecimal digit in reverse order
  3. Add dots: Place dots between each character
  4. Append domain: Add .ip6.arpa to the end

Conversion Example

IPv6 Address: 2001:db8::567:89ab

Expanded: 2001:0db8:0000:0000:0000:0567:89ab

Reversed PTR: b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa

Setting Up PTR Records

In BIND:

; Reverse zone file for 2001:db8::/32
$ORIGIN 8.b.d.0.1.0.0.2.ip6.arpa.
$TTL 86400

@   IN  SOA ns1.example.com. hostmaster.example.com. (
            2025101901  ; Serial
            3600        ; Refresh
            1800        ; Retry
            604800      ; Expire
            86400 )     ; Minimum

    IN  NS  ns1.example.com.
    IN  NS  ns2.example.com.

; PTR records
b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0  IN  PTR  www.example.com.

In Cloudflare:

Cloudflare supports reverse zones with the following steps:

  1. Add the ip6.arpa zone to your account
  2. Create PTR records using the reversed notation
  3. Coordinate with your IP provider to delegate the reverse zone

Important Considerations

TTL Considerations for Dual-Stack DNS

Time to Live (TTL) values control how long DNS records are cached. Proper TTL configuration is critical for dual-stack deployments:

Best Practices

  1. Synchronize TTLs: Use identical TTL values for corresponding A and AAAA records

    www     300  IN  A     192.0.2.1
    www     300  IN  AAAA  2001:db8::1
    
  2. Start Conservative: Use shorter TTLs (300-600 seconds) during initial IPv6 deployment for quick rollback capability

  3. Increase Gradually: After confirming stability, increase TTL to reduce DNS query load:

    • Testing phase: 300 seconds (5 minutes)
    • Stable production: 3600 seconds (1 hour)
    • Very stable services: 86400 seconds (24 hours)
  4. Lower Before Changes: Reduce TTL 24-48 hours before planned DNS changes

TTL Impact on User Experience

Dual-Stack DNS Setup Best Practices

Deploying both IPv4 and IPv6 requires careful planning to ensure seamless connectivity:

Essential Guidelines

1. Service Parity

2. DNS Server Dual-Stack

3. Happy Eyeballs Compatibility

4. Monitoring and Testing

5. Avoid Common Pitfalls

Verification and Testing

After adding IPv6 DNS records, thorough testing is essential:

Command-Line Testing

Check AAAA records:

dig example.com AAAA
nslookup -type=AAAA example.com
host -t AAAA example.com

Check reverse DNS:

dig -x 2001:db8::1
host 2001:db8::1

Test from both protocols:

curl -4 https://example.com  # Force IPv4
curl -6 https://example.com  # Force IPv6

Online Testing Tools

Comprehensive IPv6 Testing: Use test-ipv6.run to validate your IPv6 configuration. This tool tests:

DNS Propagation:

IPv6 Connectivity:

Troubleshooting Common Issues

AAAA record not resolving:

IPv6 connectivity fails despite correct DNS:

Mixed results from different locations:

Conclusion

Adding IPv6 to DNS is a straightforward process across modern platforms, whether you're using managed services like Cloudflare and Route 53 or running your own BIND servers. The key principles remain consistent:

  1. Use AAAA records for IPv6 addresses
  2. Maintain service parity between IPv4 and IPv6
  3. Synchronize TTL values across record types
  4. Configure reverse DNS for better deliverability and diagnostics
  5. Test thoroughly using tools like test-ipv6.run

By following these best practices, you'll ensure smooth dual-stack operation and position your infrastructure for the IPv6-dominant future. Remember to test your configuration regularly and monitor for asymmetric connectivity issues as you deploy IPv6 across your services.