Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 6 down vote accepted

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 10.0.204.255
10.0.204.14 mress<00>
10.0.204.14 mress<00>
share|improve this answer
1  
Thanks, the .local worked. nmblookup found it as well. –  Rick Mar 4 '11 at 21:35

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.