Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Which is really handy. When testing if you're online, running "ping 1.1" is far quicker than "ping 8.8.8.8" or "ping 1.1.1.1"


Why am I today just learning that `ping` will stuff 0's into octets you omit from an address? All of the keystrokes I could have saved and minutes on the phone I could have saved doing `ping 192.168.1` instead!


It's not omitting and it's not just zeros: try `ping 127.256` and `ping 127.65536`.


It's not ping. It's a common C library routine used by quite a number of programs that does this. And this is old behaviour of that library function, that has been around for decades. Here's FreeBSD's library function from 1994, and it was fairly old then:

* https://github.com/dspinellis/unix-history-repo/blob/FreeBSD...


I am even MORE surprised that Windows PING also supports this!


Remember the windows IP stack originated from the BSD stack


Ah yeah, forgot that. :)


Today I also learned. Thanks!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: