127.0.0.0/8 — the whole loopback /8
Everyone knows 127.0.0.1. Fewer know that the entire 127.0.0.0/8 — all 16,777,216 addresses from 127.0.0.0 to 127.255.255.255 — is loopback. RFC 1122 reserves the whole block: any packet sent to any 127.x address comes right back to the sending host and never touches a wire.
That makes 127/8 the safest address space in computing: it cannot collide with a LAN, cannot be routed, cannot leak. A 127.x packet appearing on a physical interface is, by definition, a martian.
| Range start | 127.0.0.0 |
| Range end | 127.255.255.255 |
| Subnet mask | 255.0.0.0 |
| Wildcard mask | 0.255.255.255 |
| Total addresses | 16,777,216 |
Loopback reserves the entire /8 for the local host (RFC 1122), so the usual network/broadcast/usable-host columns describe nothing real — these are the range boundaries.
How loopback actually works
The operating system creates a virtual interface — lo on Linux, the Loopback Pseudo-Interface on Windows — and routes the whole /8 to it. Packets addressed to 127.anything are processed entirely inside the kernel's network stack: they never reach the NIC, never need a driver, never leave the machine. That is why pinging 127.0.0.1 tests your TCP/IP stack but tells you nothing about your network card.
localhost is just a name for it: the hosts file maps it to 127.0.0.1 (and ::1 for IPv6), and RFC 6761 requires resolvers to answer "localhost" with loopback addresses so the name cannot be hijacked by a DNS server.
Why 127.0.0.53 and friends exist
Because the whole /8 loops back, different services can occupy different 127.x addresses on the same port. systemd-resolved listens on 127.0.0.53:53 so it can run a stub DNS resolver without fighting anything else for port 53. Debian-based systems map the machine's hostname to 127.0.1.1, and some VPN clients park split-DNS resolvers on addresses like 127.0.2.1.
A dev trick worth knowing
Running two local services that both want the same port? Bind one to 127.0.0.2 and the other to 127.0.0.3 — no containers, no port remapping, both reachable at distinct IPs. It is also a clean way to run a local DNS server or a test mail sink without touching your LAN address.
CIDR Calculator
Run the math on 127.0.0.0/8 — or any other block
Frequently asked questions
Is 127.0.0.1 the only loopback address?
No — the entire 127.0.0.0/8 is loopback per RFC 1122; 127.0.0.1 is just the conventional choice. Try pinging 127.44.88.9: it works on any standards-compliant stack.
What is 127.0.0.53?
The stub DNS resolver of systemd-resolved, standard on most modern Linux desktops. It listens on that loopback address so it can own port 53 without conflicting with other resolvers.
Can 127.x.x.x traffic leave my computer?
No. Loopback packets are handled entirely inside the OS network stack. A 127.x packet on a physical network is invalid, and any host or router should drop it as a martian.
Is localhost the same as 127.0.0.1?
Practically, yes: "localhost" resolves to 127.0.0.1 via the hosts file (and ::1 for IPv6). RFC 6761 requires the name to always resolve to loopback.