IPv6 Compressor & Expander
Convert IPv6 addresses between compressed and 32-digit expanded representations. Generate reverse DNS .ip6.arpa pointers and inspect network prefixes.
Documentation Prefix (2001:db8::/32)
Reserved by IANA for documentation, technical books, and code examples (RFC 3849)
Shortest valid canonical representation (lowercase hex, leading zeros stripped, longest 0-run replaced with ::).
All 8 groups fully expanded with 4 hex digits each (zero-padded).
Used by mail servers and network diagnostic tools to perform reverse IP verification.
1.0.0.0.0.0.0.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.2001:0db8:0000:0000::/64
0000:0000:0000:0001
128-Bit IPv6 Architecture & Migration Guide
01.The 128-Bit Address Space Anatomy
While IPv4 provides approximately 4.29 billion 32-bit addresses, IPv6 features a 128-bit address space accommodating 3.4 × 10^38 addresses—enough to assign millions of addresses to every grain of sand on Earth.
A standard unicast IPv6 address is split cleanly into two 64-bit segments:
- Routing Prefix + Subnet ID (First 64 bits): Assigned by your Regional Internet Registry (RIR) and ISP to identify your network.
- Interface ID (Last 64 bits): Uniquely identifies the physical or virtual network interface on that local link (EUI-64 or randomly generated privacy extensions).
02.RFC 5952 Canonical Compression Rules
To eliminate ambiguity when storing or parsing IPv6 addresses in logging databases, RFC 5952 established strict canonical representation rules:
- Suppress Leading Zeros:
0db8must be written asdb8. Single0000blocks become0. - Longest Zero Run Only: The double colon
::must compress the longest consecutive sequence of 16-bit zero fields. - No Single Zero Compression: A single 16-bit zero field must not be collapsed to
::(e.g.2001:db8:0:1:1:1:1:1). - Tie-Breaking: If multiple zero runs are of equal length, compress the first occurrence.
- Lowercase Hex: Hex characters
a-fmust always be lowercase.
03.Reverse DNS in IPv6 (.ip6.arpa)
Just like IPv4 uses .in-addr.arpa, IPv6 uses the .ip6.arpa special domain zone to translate IP addresses back to canonical hostnames.
Because IPv6 addresses are 128 bits (32 hexadecimal nibbles), the fully expanded address must be written in reverse order with each nibble separated by a period:
Mail servers verify PTR records on incoming SMTP connections to ensure the sending IP is legitimate and prevent spam.
04.Dual-Stack & Transition Mechanisms
The transition from IPv4 to IPv6 does not require an abrupt cutover. Production infrastructure relies on:
- Dual-Stack Networking: Hosting servers bind both an IPv4 (A) and IPv6 (AAAA) record simultaneously. Clients connect over IPv6 when available, falling back to IPv4 (Happy Eyeballs algorithm RFC 8305).
- IPv4-Mapped Addresses (::ffff:x.x.x.x): Allows modern dual-stack socket applications on Linux/BSD to handle incoming legacy IPv4 connections within an IPv6 API wrapper.