在 macOS 上,如何获取本地网络上 Windows 计算机的 IP 地址?

And*_*rea 7 networking windows wins-server smb macos

我可以连接到网络上的 Windows PC 以在 Finder 中的“共享”部分或使用“前往 > 连接到服务器...”进行文件共享,但是我如何找到它的 IP 地址?

And*_*rea 9

命令行smbutil实用程序是您所追求的:

$ 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)
Run Code Online (Sandbox Code Playgroud)

您可以smbutil lookup <name>在终端中查找机器的 IP 地址:

$ 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
Run Code Online (Sandbox Code Playgroud)

或者使用以下命令查找机器名称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
Run Code Online (Sandbox Code Playgroud)

感谢 11rcombs告诉我这件事。)