Is 0.0.0.0 a valid IP address?

后端 未结 10 1104
遇见更好的自我
遇见更好的自我 2020-11-29 04:14

Is 0.0.0.0 a valid IP address? I want my program to be able to store it as an indication that no address is in use, but this won\'t work if it\'s actually valid.

相关标签:
10条回答
  • 2020-11-29 04:59

    Doing a Network Whois query can also produce output that is quite helpful.
    Example:
    http://whois.arin.net/rest/nets;q=0.0.0.0?showDetails=true

    Comment: The address 0.0.0.0 may only be used as the address of an outgoing packet when a computer is learning which IP address it should use. It is never used as a destination address. Addresses starting with "0." are sometimes used for broadcasts to directly connected devices.

    0 讨论(0)
  • 2020-11-29 05:09

    It's reserved as the default route address.

    It's common to see this via ipconfig when no address has been assigned to you.

    0 讨论(0)
  • 2020-11-29 05:09

    for all intents and purposes, yes. Each of the four numbers separated by the period have a value ranging from 0-255, so 0.0.0.0 is technically valid.

    I don't think that there would be anyone in the world who actually has that IP though.

    EDIT: okay, it is reserved for the default route, but it is still valid.

    0 讨论(0)
  • 2020-11-29 05:10

    The 0.0.0.0 is used to bind all IPv4 interfaces. So it's a special value just like 127.0.0.1.

    0 讨论(0)
提交回复
热议问题