11.5 The ABCs of IPv6 Addressing

The Microsoft DNS Server supports the new AAAA record necessary for IPv6. We thought some information on the representation and structure of IPv6 addresses would be appropriate to help you understand the record.

IPv6 addresses are 128 bits long. The preferred representation of an IPv6 address is eight groups of as many as four hexadecimal digits, separated by colons. For example:

`0123:4567:89ab:cdef:0123:4567:89ab:cdef`

The first group of hex digits (0123, in this example) represents the most significant (or highest order) four bits of the address.

Groups of digits that begin with one or more zeros don't need to be padded to four places, so you can also write the previous address as:

`123:4567:89ab:cdef:123:4567:89ab:cdef`

Each group must contain at least one digit, though, unless you're using the :: notation. The :: notation allows you to compress sequential groups of zeros. This comes in handy when you're specifying just an IPv6 prefix. For example, this notation:

`dead:beef::`

specifies the first 32 bits of an IPv6 address as dead:beef and the remaining 96 as zeros.

You can also use :: at the beginning of an IPv6 address to specify a suffix. For example, the IPv6 loopback address is commonly written as:

`::1`

or 127 zeros followed by a single one. You can even use :: in the middle of an address as a shorthand for contiguous groups of zeros:

`dead:beef::1`

You can use the :: shorthand only once in an address since more than one could be ambiguous.

IPv6 prefixes are specified in a format similar to IPv4's CIDR notation. As many bits of the prefix as are significant are expressed in the standard IPv6 notation, followed by a slash and a decimal count of exactly how many significant bits there are. So the following three prefix specifications are equivalent (though obviously not equivalently terse):

```dead:beef:0000:00f1:0000:0000:0000:0000/64

11.5.1 IPv6 Forward and Reverse Mapping

Clearly, the existing A record won't accommodate IPv6's 128-bit addresses. RFC 1886 defines the solution: an address record that's four times as long as an A record. That's the AAAA (pronounced "quad A") record. The AAAA record takes as its record-specific data the textual format of an IPv6 record as described earlier. So for example, you'd see AAAA records like this one:

`ipv6-host    IN    AAAA    4321:0:1:2:3:4:567:89ab`

RFC 3152 established ip6.arpa, a new reverse-mapping namespace for IPv6 addresses.[6] Each level of subdomain under ip6.arpa represents four bits of the 128-bit address, encoded as a hexadecimal digit just like in the record-specific data of the AAAA record. The least significant (lowest order) bits appear at the far left of the domain name. Unlike the format of addresses in AAAA records, omitting leading zeros is not allowed, so there are always 32 hexadecimal digits and 32 levels of subdomain below ip6.arpa in a domain name corresponding to a full IPv6 address. The domain name that corresponds to the address in the previous example is:

[6] Several aspects of IPv6 addressing have been a moving target within the Internet standards community. We should point out that the original domain for IPv6 reverse mapping as defined in RFC 1886 was ip6.int. This domain was changed to ip6.arpa by RFC 3152 for both technical and political reasons.

`b.a.9.8.7.6.5.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.0.0.0.0.1.2.3.4.ip6.arpa.`

These domain names have PTR records attached, just as the domain names under in-addr.arpa do:

```b.a.9.8.7.6.5.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.0.0.0.0.1.2.3.4.ip6.arpa.  IN  PTR
mash.ip6.movie.edu.```

 Preface
 Chapter 1. Background
 Chapter 2. How Does DNS Work?
 Chapter 3. Where Do I Start?
 Chapter 4. Setting Up the Microsoft DNS Server
 Chapter 5. DNS and Electronic Mail
 Chapter 6. Configuring Hosts
 Chapter 7. Maintaining the Microsoft DNS Server
 Chapter 8. Integrating with Active Directory
 Chapter 9. Growing Your Domain
 Chapter 10. Parenting
 Chapter 12. nslookup and dig
 Chapter 13. Managing DNS from the Command Line
 Chapter 14. Managing DNS Programmatically
 Chapter 15. Troubleshooting DNS
 Chapter 16. Miscellaneous
 Appendix A. DNS Message Format and Resource Records
 Appendix B. Converting from BIND to the Microsoft DNS Server
 Appendix C. Top-Level Domains
 Colophon