简体   繁体   中英

why I can not ping the specific host name in /etc/hosts under Mac OS Yosemite 10.10.1?

I add a subdomain into file /etc/hosts:

0.0.0.0 localhost.lan group1.localhost.lan group2.localhost.lan

and then in the terminal:

ping localhost.lan 

I got the error msg:

ping: sendto: No route to host
ping: sendto: No route to host
Request timeout for icmp_seq 0

But in my another machine with Fedora Linux 20 , it can work well! I don't know what software I install in my linux let ping to work, or Mac OS has other rules?

Any advice will be welcome!

On Mac OS X, 0.0.0.0 does not point at localhost as on Linux. If you point it at 127.0.0.1 or ::1 , it will work.

As far as I know 0.0.0.0/8 is a reserved address space that's used to broadcast messages to the current network. According to RFC 1700 it can only be used as a source address, not as a destination.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM