On macOS, how do I get the IP address of a Windows machine on my local network?

The command-line smbutil utility is what you are after:

$ 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
 statshares list the attributes of mounted share(s)

You can look up a machine's IP address with smbutil lookup <name> in Terminal:

$ smbutil lookup Example-Name
Got response from 192.168.1.110
IP address of Example-Name: 192.168.56.1
IP address of Example-Name: 192.168.1.110

Or look up the machine's name with smbutil status <IP>:

$ smbutil status 192.168.1.110
Using IP address of 192.168.1.110: 192.168.1.110
Workgroup: WORKGROUP
Server: EXAMPLE-NAME

(Credit to 11rcombs for telling me about this.)


If you cannot get smbutil to work - sometimes it doesn't & I'm not good enough with SMB to know why, then arp might be useful instead.

For example [content trimmed to relevant lines only]
ol-server is a Windows machine I am currently already connected to. I have drives mounted & an open RDC session.

TetsMac:~ glee$ smbutil lookup ol-server
smbutil: unable to resolve ol-server: No route to host
TetsMac:~ glee$ arp -a
ol-server (192.168.0.3) at 0:21:91:e7:9c:a3 on en1 ifscope [ethernet]