I'd like to find out the computer name of a Windows PC (like the name shown in the 'Shares' section of the Finder, e.g. bill-pc) given only its IP address. nslookup doesn't do the trick.

I'm also interested in the reverse lookup: given its Windows name, how can I find out its IP address? ping bill-pc or ping bill-pc.local seems not to work in some cases.


If you're using Lion, you can use smbutil:

usage: smbutil [-hv] subcommand [args]
where subcommands are:
 help       display help on specified subcommand
 lookup     resolve NetBIOS name to IP address
 status     resolve IP address or DNS name to NetBIOS names
 view       list resources on specified host
 dfs        list DFS referrals
 identity   identity of the user as known by the specified host

For example (assuming is a valid IP on your network):

smbutil status
smbutil lookup bill-pc

If you're using Snow Leopard, you should be able to use nmblookup:

nmblookup -A
nmblookup bill-pc

You must log in to answer this question.

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