Loopback Address

    Address that always refers to the local host and never leaves the machine — `127.0.0.1` in IPv4 and `::1` in IPv6.

    A loopback address points back to the local host. The TCP/IP stack short-circuits packets sent to it through the virtual loopback interface (lo on Linux, lo0 on BSD and macOS), so they never touch a physical NIC or any wire. IPv4 reserves the entire 127.0.0.0/8 block for this purpose; by convention applications use 127.0.0.1, but any address in that range resolves to the same host. IPv6 is stricter and reserves a single address, ::1/128.

    Loopback is the standard way to bind services that should not be reachable from the network — a local database, a development web server, an admin interface — by listening on 127.0.0.1 (or ::1) instead of 0.0.0.0/::. The hostname localhost is wired to these addresses through the hosts file on every operating system.

    It is also a baseline diagnostic. A successful ping to 127.0.0.1 or ::1 confirms the IP stack itself is functional; a failure points at the OS networking layer rather than the NIC, the cable, or any remote host. Because loopback traffic never enters the routing table, traceroute to a loopback address returns immediately with zero hops.

    Key Points

    • IPv4: entire 127.0.0.0/8 reserved; 127.0.0.1 by convention
    • IPv6: single address ::1/128
    • Handled by the loopback interface; traffic never reaches a physical NIC
    • localhost resolves to loopback via the OS hosts file
    • Binding a service to loopback prevents network exposure
    • A successful ping to loopback proves the local IP stack works

    Related Terms

    Related Tools