I have a MBP running 10.6. This is my first mac.

In finder, it sees the windows 7 machines and windows home server just find. I can click on those computers and see their shares. If I open up terminal and try to ping the computer name, it doesn't resolve. I have had to add the computers to the host file. I don't understand why finder appears to associate the name with the correct server from the terminal doesn't. Can somebody explain it or explain how I can get the same behavior from terminal?

3 Answers 3


If a machine is found via Bonjour/multicast DNS, you may need to add a .local suffix to use the hostname in Terminal. If it was found via NetBIOS (either broadcast or WINS), you may need to use nmblookup to get an IP address:

rushlight:10120 Z$ nmblookup mress
querying mress on mress<00> mress<00>

ping on Mac OS X uses basic host lookup via DNS or Bonjour, but your Windows machines are (most likely) being advertised on your network by NetBIOS which ping doesn't consult.


If the ping can't resolve the host, then it's a DNS issue; your computer doesn't have a way to translate the computer name into an IP address.

When Finder looks for computers to share files with, it probably sends a packet to what's called a "multicast" address, which just means it goes to all devices on the network/subnet. It'll say something to the effect of "Hey, do you want to share files?" Any computers with file sharing enabled will respond. This can also be accomplished through Bonjour.

As far as how to get Terminal to do the same thing, I don't think you can link it with Finder's list of file-sharing partners. When given a computer name, ping will need an IP to send its request to, and that has to come from either DNS or your hosts file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .