nbtstat -a ip 命令查主机名

在网上查到的,用nbtstat -a 命令,实验成功:

C:Documents and Settingszxh.ZXH-CYZZ>nbtstat -a 192.168.1.7

本地连接: Node IpAddress: <192.168.1.7> Scope Id: <>

NetBIOS Remote Machine Name Table

Name Type Status --------------------------------------------- SERVER <00> UNIQUE Registered SERVER <20> UNIQUE Registered CY <00> GROUP Registered CY <1E> GROUP Registered CY <1D> UNIQUE Registered ..__MSBROWSE__.<01> GROUP Registered

MAC Address = 00-1C-C4-43-9D-CC

查到IP为192.168.1.7的机器名为“server”,隶属工作组“CY”及其MAC地址。

该命令详细内容如下:

Displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP).

(显示协议统计和当前TCP/IP连接使用的NBT)

NBTSTAT < <-a RemoteName> <-A IP address> <-c> <-n> <-r> <-R> <-RR> <-s> <-S> >

-a (adapter status) Lists the remote machines name table given its name

(通过给出的机器名列出远程机器的名字表) -A (Adapter status) Lists the remote machines name table given its IP address.

(通过给出的IP地址列出远程机器的名字表) -c (cache) Lists NBTs cache of remote names and their IP addresses

(列出NBT缓存中远程机器的名字机器IP地址) -n (names) Lists local NetBIOS names.

(列出本机NetBIOS名字) -r (resolved) Lists names resolved by broadcast and via WINS -R (Reload) Purges and reloads the remote cache name table -S (Sessions) Lists sessions table with the destination IP addresses -s (sessions) Lists sessions table converting destination IP addresses to computer NETBIOS names. -RR (ReleaseRefresh) Sends Name Release packets to WINS and then, starts Refresh

RemoteName Remote host machine name. IP address Dotted decimal representation of the IP address. interval Redisplays selected statistics, pausing interval seconds between each display. Press Ctrl+C to stop redisplaying statistics.

  只有当网际协议 (TCP/IP) 协议在 网络连接中安装为网络适配器属性的组件时,该命令才可用。   范例   要想显示以太网统计信息和所有协议的统计信息,请键入下列命令:

  netstat -e -s

  要想仅显示 TCP 和 UDP 协议的统计信息,请键入下列命令:

  netstat -s -p tcp udp

  要想每 5 秒钟显示一次活动的 TCP 连接和进程 ID,请键入下列命令:

  nbtstat -o 5

要想以数字形式显示活动的 TCP 连接和进程 ID,请键入下列命令: nbtstat -n -o

经验分享 程序员 微信小程序 职场和发展