Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there an easy way from the OS X (Lion) command line or Finder to determine the IP address of a Windows machine on the same subnet (in a home network)? Assume the machine itself is not easily accessible.

I know of the following ways:

  • Refer to the router(dhcp server)'s web admin page.
  • Use arp -a to get a list of recently accessed IPs and guess from there.

The machine does show up in Finder, so I know it's network computer name (which I'm guessing is a WINS name?), but not what workgroup it is. We are not on a domain.

I'm not entirely sure how OS X "maps" an SMB/WINS name, since doing something like pinging "mywindowsbox" fails, as does pinging "mywindowsbox.local".

share|improve this question
    
If you can find a way to inferface with the DHCP, that should be able to give you a list of all active IPs –  Alex Waters Sep 2 '11 at 5:30
add comment

4 Answers

Use smbutil lookup HOSTNAME (Source).

This will give you the IP address of a given NetBIOS name.

I presume it’s the same as what the Finder does when connecting to an smb:// URL, so it’s probably subject to the same limitations (I don’t actually know what these are but I’ve noticed that the Finder is not always able to look up windows machines in the local network when other windows clients seemingly have no problem doing so).

share|improve this answer
add comment

Do you not have access to the Windows machine?

Can you ping the IP of the Windows machine? If not, perhaps the Windows machine has its software firewall on preventing pings.

Also, if you have access to the router, it might list the hostname of the Windows machine.

update: Well, the name that shows up in the Finder should be the PCs hostname.

share|improve this answer
    
I've updates the question to provide more details. I don't have physical access to the machine. Not knowing the IP, what would I ping? –  Chris Weiss Sep 2 '11 at 15:57
add comment

If you have nmblookup installed, try:

nmblookup hostname

Hostname would be the WINS name. This might return the IP address. Also look at the nmblookup man pages for other options that might get this working.

share|improve this answer
add comment

If you are on a closed network (private) and you are on a typical class C subnet (255.255.255.0) you can ping XXX.XXX.XXX.255. The .255 address is the broadcast address for the class C. Theoretically all hosts on the subnet will send ICMP echos to you. This should narrow down what hosts are actually alive on the network. From there, you can use the Network Utility (/Applications/Utilities/Network Utility.app) to do some fingerprinting and port scanning to figure out which one it is.

However, if the Windows machine ICMP echos disabled, this plan is foiled.

Just a note: the *.local domain is used for Bonjour. Unless the Windows box has Bonjour (or mDNSResponder) querying the local domain won't work.

share|improve this answer
add comment

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.