2

I accidentally hit return too early when attempting to ping a device, so instead of ping 10.111.12.4 I typed

C:\Users\roadierich>ping 10.111

Pinging 10.0.0.111 with 32 bytes of data:
Request timed out.

I was surprised to see that the IP address was expanded to fill the missing octets.

After further experimentation, I discovered:

ping 1       => ping 0.0.0.1
ping 1.2     => ping 1.0.0.2
ping 1.2.3   => ping 1.2.0.3
ping 1.2.3.4 => ping 1.2.3.4 (as expected)

Based on cursory testing, tracert

I've searched google, but I can't find any reference to this behavior. Is this an actual standard, a defacto standard implemented across every tool taking an I.P. address as an argument, or is it unique to windows?

I know under IPv6 it's acceptable to omit strings of consecutive zeros, but the delimiting characters are still present.

RoadieRich
  • 131
  • 9

1 Answers1

0

Standard? No, if by "standard" you mean "is globally expected to work this way".

In this case, Microsoft were doing us a favour (whether intentionally, or because the Windows "ping" authors added extra code because they wanted it).

At any rate, there's an excellent answer at https://superuser.com/a/486936.