IP Commands

IP Commands

Determining the computer name associated with an IP address (Windows 2000 / XP / 2003 / Vista)

Adapted from a discussion paper by Diana Huggins in February 2005

Finding the IP address assigned to a particular computer on the network is quite simple. There is a DOS command that can be used and this has two distinct switches (-a and -A).

To discover the IP address associated with a specific computer name, you can use the NBTSTAT command. The syntax for doing so is as follows:

NBTSTAT -a <computername>

The reverse of this is to find out the computer name associated with a specific IP address? Once again using the NBTSTAT command with a different switch as shown below.

NBTSTAT -A <ipaddress>

The results will tell you the computer name that is currently associated with the IP address you have specified.

The full explanation for the NBTSTAT command is as follows:

 

Switch

Explanation

NBTSTAT [ [-a RemoteName] [-A IP address] [-c] [-n] [-r] [-R] [-RR] [-s] [-S] [interval] ]

-a

(adapter status) Lists the remote machine's name table given its name

-A

(Adapter status) Lists the remote machine's name table given its IP address.

-c

(cache) Lists NBT's cache of remote [machine] names and their IP addresses

-n

(names) Lists local NetBIOS names.

-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