15

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?

Spiff
  • 101,729
  • 17
  • 175
  • 229
Lydon Ch
  • 5,789
  • 8
  • 32
  • 35

2 Answers2

35

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.

Spiff
  • 101,729
  • 17
  • 175
  • 229
  • 1
    thanks. what about finding windows/netbios mapping ? – Lydon Ch Jul 01 '12 at 16:11
  • Sorry I am very bad in regular expression.. can you give me some hints to do this with a script and repeat it for each computer on my network? – nkint Oct 14 '14 at 23:11
0

You can use netstat

Open terminal

% netstat -a | grep afp
Interlated
  • 101
  • 4