4 ms·
0.0.0.0 is a completely invalid destination IP, and any attempts to establish a connection to it will fail long before any packets are sent. 127.0.0.1 is still
by userbinator 12y ago
0.0.0.0 is a completely invalid destination IP, and any attempts to establish a connection to it will fail long before any packets are sent. 127.0.0.1 is still valid so you depend on the network stack to either receive a RST sent to itself, or time out.
At least on Windows, the former is much faster to return with an error.
It also avoids potential conflicts if you happen to need to run a server on port 80 for any reason.
- MichaelCrawford 12y agoWhen I ping 0.0.0.0, I get replies from 69.41.141.1. I don't know but expect that's earthlink's router.
- userbinator 12y agoThat's odd... on Windows, pinging 0.0.0.0 results in "Destination specified is invalid." On *nix, the behaviour is slightly different and is supposed to ping localhost instead (confirmed on one of my Linux machines): http://unix.stackexchange.com/questions/99336/how-does-ping-zero-works http://unix.stackexchange.com/questions/99336/how-does-ping-...
- MichaelCrawford 12y agoDo the RFCs have anything to say about 0.0.0.0? Perhaps it is left up to the implementation, in which case both Windows and *NIX would be, strictly speaking, correct.
- seanp2k2 12y agoThis isn't true on non-windows OSes, where 0.0.0.0 (or simply 0) means all interfaces, not nothing. ssh to a web server and do curl 0 ; it's a super-useful shortcut. Further reading: http://serverfault.com/questions/78048/whats-the-difference-between-ip-address-0-0-0-0-and-127-0-0- http://serverfault.com/questions/78048/whats-the-difference-... http://en.m.wikipedia.org/wiki/0.0.0.0 http://en.m.wikipedia.org/wiki/0.0.0.0