Determining the Computer Name Associated with an IP Address (Windows 2k/XP/2003)

Finding the IP address assigned to a computer is very simple. All you have to do is open the command prompt and use the IPCONFIG command. If you want to find 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>

What if you want to find the computer name associated with a specific IP address? The solution is simple. You can once again find the information you are looking for using the NBTSTAT command, only this time with a different switch. Instead of using -a, you will use -A and specify an IP address 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.

Article Written by

  • david.Zhu

    Thank you for your information! It’s very helpful!

  • Ken

    great information, I really need it this for work!

  • nestor

    Finding the IP address assigned to a computer with the following syntax does not give me the IP address.

    NBTSTAT -a

    I am getting the computer’s name – Why?

  • stuart

    Just found this page – very helpful. Thank you :)

  • http://wp3.lockergnome.com/windows/2005/02/01/determining-the-computer-name-associated-with-an-ip-address-windows-2kxp2003/ Martin

    this didn’t work for me.
    I used the following syntax to obtain the IP address from the computer name:
    NBTSTAT -a

    I actually got the MAC Address but did not get the IP address. There was a “Node IP Address” referenced but that was my IP address.

  • pankaj

    i used some command .. realy thaks.. it is very greatfull help..

  • Iain

    Thanks for the info, really helpful. For those who are trying to resolve an ip from a computer name, this command will only list the name table for the computer, NOT the ip address. However it is painfully easy to get the ip for a computer with only its name – ping it.

  • Viraj Perera

    Thanks lot ! This is really helpful.

  • Stephan S

    Indeed very helpful. But we have more ip ranges on our network. I’m in the 16.XX range and the PC i want to have the from is in the 17.XX range. Anyone who know how that works

  • alas32

    The command is “nbtstat -a NAME”, not just “nbtstat -a”

  • Stephen Chettiar

    fantastic!
    NBTSTAT command is exaclty what i was looking for.
    thanks a ton.

  • Vish

    Great find! excellent resource!

  • http://wp3.lockergnome.com ABDO HASSAN ABDO

    How Can I Get into Another Comp. I Got IP And Mac Add. And Evry Detail But I Wanna Get onto this Comp. Becuse They Get my Speedtuche.lan And I get

    They IP + MAC + And Name pc But Icant Get Inside it

    Help

  • Venkatesh

    This info was very much helpful….Thanks

  • wail

    that is cool ., thank you for the good information ,, it work fine ,, shokran –>thank u

  • Aks

    nbtstat doesnt give me the IP address from computername .. but works great for getting the computername from ip address.. To get the ip address simply ping with computername

    ping

    This will give the IP of the target

  • Anil

    Thanks Brother

  • Shawn

    Thanx a lot

  • LIJU

    Really Helpfull

  • Latika

    This is gr8 ! Thanks

  • Andra

    Very helpful

  • dd

    There’s a difference between:
    NBTSTAT -A
    and
    NBTSTAT -a

    Use A.

  • Parag

    Great! it’s really helpful.

  • Phaneendranatha

    Can i know remote system name using remote system IP Address????

  • http://wp3.lockergnome.com/windows/2005/02/01/determining-the-computer-name-associated-with-an-ip-address-windows-2kxp2003/ TENDUL001

    This helps me to find out the person who is accesing my computer without my permission

  • Wajahat Khalid

    This really helped me in getting Computer name on our office LAN against the ip address that i wanted to locate.

  • silber1

    Great help!
    Thanks

  • http://www.xainakhtar.webs.com Xain

    i use it command it worked ,.. i m Happy

  • hwang

    when i log it says

  • hwang

    Failed to access NetBT driver — NetBT may not be loaded

    any idea?

  • Tamer

    to know IP address when u know the exact hostname ex.: XXX
    (as someone said before)
    >Ping XXX
    Pinging XXX [THE IP Address appear here] with 32 bytes of data:

    Reply from THE IP Address appear here TOO: bytes=32 time<1ms TTL=128

  • Ethan

    Thanks abunch mate……..this is a very helpful command to know !!

    Great work !

  • Mance

    i like to use Ipconfig/all

  • Bhaskar

    Thanks it works fine with Window OS hosts..

    it does not work to obtain the computer name for any remote mechine with other Operating system than windows like Linus or Unix etc..

    Please let me know if any body knows the command to obtain the computer name of remote mechine with LINUX OS from the Windows OS mechine…

  • http://yahoo.com Rahul

    its very helpful

  • Viren

    Thank , very helpfull

  • mHondz

    I use NBTSTAT -a [RemoteName] to get the IP address but the result is Host not found. But when I use NBTSTAT -A [IP address] it shows the result succesfully.

    Any idea about Host not found i got?

  • mHondz

    Note: For me NBTSTAT -a [RemoteName] only works with the same IP segment.

    @ Aks & Tamer
    For me It only applies with the same IP segment.

  • sivakumarv

    I have used this NBTSTAT command, for few of the ip’s i am getting the computer name but not to every ip address in my network. Can any body tell the reason. here is the out put i got:
    ——————————————————————–
    Local area Connection:
    Node IP address:[172.16.75.62] Scope Id : [ ]
    Host Not Found
    ——————————————————————–
    My IP address is 172.16.75.62 and i requested is 172.16.85.238 with in my local

  • veeresh

    Thank so much .

  • http://rwec.co.uk Stavron

    For those saying that you can get the IP address just by pinging the machine, this is not always the case – the same name can resolve to a different name for “ping” than for Windows networking. For instance, “ping foo” might attempt to resolve “foo.com” (via Windows’ “helpful” DNS resolution), where “\\foo” would show a machine named “foo” on the local network.

    However, it seems nbtstat does find the IP address, it just doesn’t display it; so if you show it’s cache with “nbtstat -c”, you can see it:

    > nbtstat -a foo
    > nbtstat -c

  • http://readerszone.com Ajay

    hey thanks for this use command.

  • jMi_wapohehehe

    excellent! this is what i am looking for, nbstat using both params (a and A).

  • http://yahoo joseph

    thank you very much!!!

  • pazz

    thanks.. nice

  • XtatiK

    you can also do ping -a :)