The Blog

Dec 28, 2007

Ah! So THAT's How You Ping Local Mac Servers... 

by Maxim Porges @ 8:36 PM | Link | Feedback (0)

I've always been annoyed that my Mac can find other Macs on my local network, but that I can't ping them using the names I've given them. For example, my G4 tower is named "zaphod", but if I run "ping zaphod" from Terminal I get "host not found." Usually, you would have a DNS server set up, or an entry in your hosts.conf file for other machines - but how does OS X automatically find these other machines in the absence of either of these solutions?

Well, I did a little research on the "mdns://" protocol I had to use to configure one of my printers over Bonjour, and it turns out that this is the "Multicast DNS" protocol which is what Bonjour and zeroconf networking are based on. A little Googling got me to this page, which tipped me off on how to resolve addresses for machines on my local network without setting up DNS.

So, to ping any server on my local network, all I need to do is append ".local" to the machine name. So, to ping zaphod, I type "ping zaphod.local" in to Terminal, and Bob's your uncle. This works equally well for the "Connect to Server" dialog and all the other IP-or-server-name-requiring utilities in OS X.