Loopback Addresses
You landed here because the address you looked up is a loopback address — a packet destined to it never crosses the wire. The host’s own network stack accepts the packet and delivers it back up locally. RFC 1122 reserves the entire 127.0.0.0/8 block for this purpose, and RFC 4291 reserves ::1/128 as the IPv6 equivalent.
Frequently asked questions
What is the difference between 127.0.0.1 and localhost?
`localhost` is a hostname that by convention resolves to the loopback address — 127.0.0.1 on IPv4 and ::1 on IPv6. The resolution happens via /etc/hosts on Unix-likes and via the hosts file on Windows. If your resolver misbehaves, `localhost` may resolve to ::1 first on some systems and 127.0.0.1 first on others, which is a common source of 'connection refused' bugs when a service binds to only one of the two families.
Why does the loopback range cover a full /8?
RFC 1122 reserved the entire 127.0.0.0/8 block as loopback in 1989, even though only 127.0.0.1 is ever used in practice. The extra 16.7 million addresses are wasted, which is one of the running jokes of IPv4 exhaustion. IPv6 only reserves a single address (::1/128), learning from that mistake.
Can loopback addresses appear in BGP?
No. Any BGP speaker that tries to announce 127.0.0.0/8 or ::1 is in violation of bogon filters and should be dropped at every ingress. The only legitimate use of 'loopback' in BGP is the loopback interface concept — a virtual interface on a router assigned a real public IP, used as a stable source address for iBGP sessions. That is unrelated to 127/8.
Why does ::1 have no ASN?
::1 is a single reserved IPv6 address that exists independently on every host on earth. No RIR delegates it, no operator owns it, and no BGP announcement covers it. There is no record to return.
Can I ping 127.0.0.2?
On most Linux systems yes — the whole 127.0.0.0/8 is typically assigned to the loopback interface, so any address in that range pings locally. macOS and some BSDs only bind 127.0.0.1 by default and require `ifconfig lo0 alias 127.0.0.2` to activate additional loopback addresses.
Related reading
- Private IPs (RFC 1918)
- Link-local addresses
- Other reserved IP ranges
- 8.8.8.0/24 (Google DNS) — example of a publicly routed prefix.