This content has moved to pzel.name

Sending 0.0.0.0 doesn't make sense

Today I learned (2018-07-21)
Tagged: networking tcp distributed-systems

While I've grown used to specifying 0.0.0.0 as the listening address for servers, I got bitten yesterday and realized the dangers of this practice.

If the listening address of a server ever needs to be communicated to others (as is the case with clustered systems), configuring 0.0.0.0 will lead to bad things happening. That is: other servers, having learned that your address is 0.0.0.0:SOMEPORT, will attempt to connect and fail.

The RFC states clearly:

This host on this network. MUST NOT be sent, except as a source address as part of an initializatioan procedure by which the host learns its own IP address.