IPv4's 32-bit addresses ran out. IPv6's 128-bit address space solves that by providing enough addresses for every device to have a unique global address without NAT. Today most infrastructure runs both, a configuration known as dual-stack.
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Address space | ~4.3 billion addresses | Vastly larger (2128) |
| Notation | Dotted decimal: 192.0.2.1 | Colon hex with :: compression: 2001:db8::1 |
| DNS record type | A record | AAAA record |
| Address scarcity | Exhausted; requires NAT | No scarcity; end-to-end addressing |
| NAT requirement | Common | Not needed |
| Header complexity | Variable-length header with optional fields | Fixed 40-byte header; extensions separate |
| Deployment | Universal | Widely deployed; dual-stack is common |
IPv4 uses 32-bit addresses, which provides approximately 4.3 billion unique values. That seemed sufficient when the protocol was designed, but the growth of the internet — and especially the proliferation of mobile devices and IoT — consumed the available space. Regional Internet Registries exhausted their free IPv4 pools, and new address blocks are now obtained through transfers or markets rather than fresh allocations.
The response to IPv4 scarcity was Network Address Translation (NAT): many devices share a single public IPv4 address, with a router tracking which internal device owns each outbound connection. NAT works, but it complicates peer-to-peer applications, breaks some protocols, and adds state to routers that would otherwise be stateless packet forwarders.
IPv6's 128-bit address space eliminates scarcity. Every device can receive a globally routable address, restoring the original internet design of end-to-end addressability without address translation.
IPv4 addresses are written as four decimal numbers separated by dots, each representing 8 bits: 192.0.2.1.
IPv6 addresses are written as eight groups of four hexadecimal digits separated by colons: 2001:0db8:0000:0000:0000:0000:0000:0001. Leading zeros within each group can be omitted, and one contiguous run of all-zero groups can be replaced with a double colon, so the example becomes 2001:db8::1.
In DNS, IPv4 addresses are published as A records and IPv6 addresses as AAAA records. A domain can carry both simultaneously. When a client performs a DNS lookup and both record types are present, modern operating systems and browsers will typically attempt IPv6 first (because IPv6 connectivity tends to be higher quality when it is available), falling back to IPv4 if the IPv6 attempt fails or is slower — a mechanism known as Happy Eyeballs.
The practical deployment reality today is dual-stack: servers publish both A and AAAA records, networks route both IPv4 and IPv6, and clients connect over whichever version is available and fastest. Pure IPv6-only deployments exist but are uncommon for public-facing services that need to reach all clients. When adding IPv6 support to a service, publishing a AAAA record alongside the existing A record is the standard first step.