Networking concepts
Loopback — 127.0.0.1 and the kernel's own network stack
The first check in every ladder: can this machine talk to itself? If not, no cable in the world will help.
Read it offline, in your terminal:
n -h loopWhat it is. 127.0.0.1 (and ::1) never leaves the machine. Packets to it go into the kernel's network stack and straight back out, without touching a network card. It's the same code path every local service uses — a database on localhost:5432, a web UI on 127.0.0.1:8080.
What the check proves. If loopback answers, the TCP/IP stack itself is fine. Anything failing further up the ladder is a cable, a router, an ISP or a name — not this computer's networking code.
Good looks like: a reply in well under a millisecond.
When it's red
- Linux: the
lointerface is down.ip link show lo; bring it up withsudo ip link set lo up. - A broken hosts file:
localhostmust map to127.0.0.1. Check/etc/hostsorC:\Windows\System32\drivers\etc\hosts—n host .audits it. - A firewall rule on loopback: rare, but a mis-typed
iptables/ufwrule or a Windows firewall profile can blocklo. Nothing legitimate ever needs to. - Windows Winsock corruption (after some VPN or antivirus uninstalls):
netsh winsock resetandnetsh int ip reset, then reboot.