How to get shared computers' IP addresses in OS X 10.7?

I have list of computers on my "Shared" sidebar, however I don't have their IP addresses.

My router has their IP addresses, however there is no computer-name <> IP address mapping.

How do I find the mapping of computer-name <> IP address?


Solution 1:

You can use a tool like Bonjour Browser or dns-sd(1) to browse services, find the hosts publishing those services, and find the IP addresses of those hosts.

With dns-sd, it might go something like this:

  1. Find hosts sharing files via the Apple Filing Protocol (AFP):

    dns-sd -B _afpovertcp._tcp local

    This will give you a list of AFP file services on your local network. You'll have to Ctrl-C out of dns-sd to get back to the shell prompt.

  2. After picking the name of an AFP service from the list, you can find out the .local hostname of the host providing that service like this:

    dns-sd -L MyOtherMac _afpovertcp._tcp local

    Again, Ctrl-C out of it after you get your answer.

  3. Resolve the "hostname.local" style mDNS host name to a set of IP addresses:

    dns-sd -G v4v6 MyOtherMac.local

    Again, Ctrl-C out of it after you get your answer.