Everybody is over-complicating it with RFCs, IP classes, and such. Simply run a few tests to see how the
ping command parses the IP input by the user (extraneous chaff removed):
Pinging 0.0.0.1 with 32 bytes of data:
Pinging 188.8.131.52 with 32 bytes of data:
Pinging 184.108.40.206 with 32 bytes of data:
Pinging 220.127.116.11 with 32 bytes of data:
Ping request could not find host 18.104.22.168.5. Please check the name and try again.
Pinging 0.0.0.255 with 32 bytes of data:
Pinging 0.0.1.0 with 32 bytes of data:
As you can see, the
ping command (in Windows) allows you to use different IP address formats. An IPv4 address can be broken down into four parts (“dotted-quad”) as so:
A.B.C.D, and the
ping command allows you to leave some out, filling in a default of
0 as follows:
1 part (ping A) : 0.0.0.A
2 parts (ping A.B) : A.0.0.B
3 parts (ping A.B.C) : A.B.0.C
4 parts (ping A.B.C.D) : A.B.C.D
If you only supply a single part, then if it is under 255 (the maximum for an octet), it is treated like an octet as above, but if it is greater than 255, then it is converted and rolled over into the next field (i.e.,
There are a few edge cases like providing more than four parts doesn’t seem to work (e.g., pinging
google.com’s IP won’t work for either
You can also use hexadecimal notation in both dotted-quad and flat form, but must format it by pre-pending
0x to each octet.
So, there are plenty of ways to represent an (IPv4) IP address. You can use flat or dotted-quad (or dotted-triple, dotted-double, or even dotted-single) format, and for each one, you can use (or even mix and match) decimal, octal, and hexadecimal. For example, you can ping
google.com in the following ways:
google.com (domain name)
22.214.171.124 (dotted decimal)
1249763844 (flat decimal)
0112.0175.0342.0004 (dotted octal)
011237361004 (flat octal)
0x4A.0x7D.0xE2.0x04 (dotted hex)
0x4A7DE204 (flat hex)
(Thank goodness that binary notation support was not added!)
In your case, pinging
192.168.072 uses the third format in the above table (
A.B.0.C), so you are actually pinging
192.168.0.072. Further, because you have a leading zero on the last part, it is treated as octal, which in decimal is 58.
Note, that while the Windows
ping command allows for such a wide variety of formats for the input and interprets non-standard formats in the ways seen, that does not necessarily mean that you can use such formats everywhere. Some programs may force you to provide all four parts of a dotted-quad, others may not allow mixing and matching decimal and octal, and so on.
Also, IPv6 addresses further complicate the parsing logic and input format acceptability.