I was recently very surprised to discover that 0.0.0.0 is a valid IP address and actually has a defined "meaning" and use.
IANA allocated 0.0.0.0/32 to mean "This host on this network" as defined by RFC 1122 section 3.2.1.3. While RFC 1122 states it must not be sent in an IP packet as a destination on the network, it does nothing to define how the address should be interpreted inside the host.
Except ... RFC 1122 names it "this host on this network" suggesting a very similar meaning to "localhost".
On Linux attempting to connect to 0.0.0.0 results in a connection to localhost (assuming something is listening). This seems in keeping with the RFC 1122 name. However I don't see it defined in standards (I'm not even sure which standard would cover it since it's internal to the OS).
So my question is: Is Linux's interpretation of connect()
to 0.0.0.0 consistent with other operating systems? Are their any notable exceptions in well known OS Kernels (Windows / UNIXs / ...).
I'm particularly interested in this as a destination address because of the rise in DNS servers "incorrectly" using 0.0.0.0 as a black hole, resulting in spurious connections to localhost.
the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown or non-applicable target
. This seems untrue unless someone can find a standard defining it thus.{0,0}
. Likewise the problem with the answer you link is it conflates with the IP block 0.0.0.0/0. In that context the text0.0.0.0
is irrelevant./0
means that literally 0 bits of that IP address are included in the CIDR block definition. So the answer horribly conflates two very different things that just like a little simiar.