IPv4 vs IPv6

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.

Quick Comparison

FeatureIPv4IPv6
Address length32 bits128 bits
Address space~4.3 billion addressesVastly larger (2128)
NotationDotted decimal: 192.0.2.1Colon hex with :: compression: 2001:db8::1
DNS record typeA recordAAAA record
Address scarcityExhausted; requires NATNo scarcity; end-to-end addressing
NAT requirementCommonNot needed
Header complexityVariable-length header with optional fieldsFixed 40-byte header; extensions separate
DeploymentUniversalWidely deployed; dual-stack is common

Address Space and Exhaustion

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.

Address Notation

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.

DNS Records: A vs AAAA

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.

Dual-Stack: Running Both Together

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.

Look up A and AAAA records with the DNS tool →