localhost
What are all these differences? And what does “local” really mean?
https://superuser.com/questions/949428/whats-the-difference-between-127-0-0-1-and-0-0-0-0
- 127.0.0.1 is the loopback address (also known as localhost)
- 0.0.0.0 is commonly used as a non-routable meta-address used to designate an invalid, unknown or non applicable target (a no particular address placeholder).
127.0.0.1 is a “fake” network adapter that can only communicate within the same host.
- “localhost” is normally the hostname for the 127.0.0.1 IP address.
- usually set in
/etc/hosts
(or the Windows equivalent named “hosts” somewhere under %WINDIR%) - If you do
ping localhost
, it resolves to 127.0.0.1
When a server is told to listen on 0.0.0.0 that means “listen on every available network interface”.
- The loopback adapter with IP address 127.0.0.1 from the perspective of the server process looks just like any other network adapter on the machine, so a server told to listen on 0.0.0.0 will accept connections on that interface too.