The loopback address is a reserved address that always refers to the local host. Packets sent to 127.0.0.1 (or any address in 127.0.0.0/8) or ::1 are handled by the operating system and never reach a physical network interface.
Why it matters
Developers use it to run and test services locally, and administrators bind sensitive services such as databases to it so only local processes can connect. The name localhost normally resolves to loopback. If a service answers on 127.0.0.1 but not on the server's public IP, it is bound to loopback only.
Example
$ curl http://127.0.0.1:3000/health
{"status":"ok"}
$ ss -ltn | grep 3000
LISTEN 127.0.0.1:3000
The app responds locally, but outside clients cannot reach it because it listens only on loopback.
Common mistakes
- Binding a public service to 127.0.0.1 and wondering why it is unreachable.
- Binding a private service to 0.0.0.0 and exposing it by accident.
- Forgetting that localhost inside a container refers to the container, not the host.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.