ping
command parses the incoming values. C:\>ping 1 Pinging 0.0.0.1 with 32 bytes of data: C:\>ping 1.2 Pinging 1.0.0.2 with 32 bytes of data: C:\>ping 1.2.3 Pinging 1.2.0.3 with 32 bytes of data: C:\>ping 1.2.3.4 Pinging 1.2.3.4 with 32 bytes of data: C:\>ping 1.2.3.4.5 Ping request could not find host 1.2.3.4.5. Please check the name and try again. C:\>ping 255 Pinging 0.0.0.255 with 32 bytes of data: C:\>ping 256 Pinging 0.0.1.0 with 32 bytes of data:
ping
command (in Windows) allows the use of different address formats. An IPv4 address can be split into four parts (octets): ABCD
, and the ping
command allows you not to specify all parts, filling in the gaps yourself using the following algorithm: 1 (ping A) : 0.0.0.A 2 (ping AB) : A.0.0.B 3 (ping ABC) : AB0.C 4 (ping ABCD) : ABCD
google.com
IP address will not work for either 0.74.125.226.4
or 74.125.226.4.0
.0x
, in the second case, the prefix 0x
indicated before the entire address. The octal system specifies the prefix 0
.google.com
address in the following ways:google.com
(domain name)74.125.226.4
(decimal notation with dots)1249763844
(decimal without points)0112.0175.0342.0004
(octal with dots)011237361004
(octal without dots)0x4A.0x7D.0xE2.0x04
(hexadecimal with dots)0x4A7DE204
(hex without dots)74.0175.0xe2.4
(ಠ_ಠ)ping
supports such a variety of formats and correctly interprets them, this does not necessarily mean that these formats can be used everywhere. Some programs may require you to enter all four octets, others may prohibit mixing octal and decimal values in one address, and so on.Source: https://habr.com/ru/post/154695/
All Articles