IP fundamentals
Loopback addresses and localhost
Loopback sends traffic back to the same host rather than through an external network.
Updated
In this guide
IPv4 and IPv6
127.0.0.0/8 is reserved for IPv4 loopback; 127.0.0.1 is the familiar example. IPv6 uses ::1. The name localhost should resolve to loopback addresses.
Local binding
A development service bound to loopback is generally reachable only on that host. Binding to all interfaces can expose it to other networks, subject to firewalls and application policy.
Do not confuse with public IP
An external website cannot reach your computer by using its own localhost. Testing a local service does not verify internet routing, DNS or public port exposure.
A local development check
A web server bound only to 127.0.0.1:8787 is normally reachable from that computer, not from a phone on the same Wi-Fi. A phone using its own localhost addresses itself. To test another device, intentionally configure an appropriate listening interface and firewall policy.
Step-by-step example
Distinguish a local development service from something reachable from the internet.
- 01
Read the loopback destinations
127.0.0.1 and ::1 refer to the current host's loopback interface. localhost is a name commonly resolved to loopback addresses.
- IPv4
- 127.0.0.1
- IPv6
- ::1
Illustration · example, not a live result - 02
Test your own local service
If you operate a service bound to 127.0.0.1 on a known port, open its local URL. A response confirms that local path only; another computer's 127.0.0.1 points to itself.
- Browser
- 127.0.0.1
- Same device
- Local service
Illustration · example, not a live result - 03
Check binding and exposure
An application bound only to loopback is not directly listening on a LAN address. Binding on other interfaces plus firewall and routing rules changes exposure. Do not open ports merely to test a local page.
- Loopback binding
- Local
- Other interface
- Separate exposure policy
Illustration · example, not a live result
Check your understanding
Never attempt public geolocation of localhost or infer remote availability from a local response.
Try this tool →Try this
Open your own local development service only through its intended loopback address.
IPv4 and IPv6 address validator →