How to get Networked Computer Name from IP Address on a LAN
Mar 13, 2015WindowsComments (35)
If you have the local IP address of a computer on your network, and need to get that computer's name, there is an easy method using the ping command in a Windows command prompt.
Command Prompt
Open up a command prompt by typing "cmd" into the start menu search (Windows Vista, 7, or newer) or by opening a Run window and then running "cmd" (Windows XP).
Use the following command to ping the local IP address (change xxx.xxx.xxx.xxx to the IP address you want to ping):
The -a option of the ping command tells it to resolve the hostname of the IP address, so it will give you the name of the networked computer.
Here is an example of the output for a hypothetical computer named "Office1" that is at local IP address 192.168.1.123:
If you need to get the hostnames and other information for all of the PCs on your network, I recommend using Advanced IP Scanner.
Command Prompt
Open up a command prompt by typing "cmd" into the start menu search (Windows Vista, 7, or newer) or by opening a Run window and then running "cmd" (Windows XP).
Use the following command to ping the local IP address (change xxx.xxx.xxx.xxx to the IP address you want to ping):
ping -a xxx.xxx.xxx.xxx
The -a option of the ping command tells it to resolve the hostname of the IP address, so it will give you the name of the networked computer.
Here is an example of the output for a hypothetical computer named "Office1" that is at local IP address 192.168.1.123:
C:\Users\Username>ping -a 192.168.1.123
Pinging Office1 [192.168.1.123] with 32 bytes of data:
Reply from 192.168.1.123: bytes=32 time<1ms TTL=128
Reply from 192.168.1.123: bytes=32 time<1ms TTL=128
Reply from 192.168.1.123: bytes=32 time<1ms TTL=128
Reply from 192.168.1.123: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.1.123:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Pinging Office1 [192.168.1.123] with 32 bytes of data:
Reply from 192.168.1.123: bytes=32 time<1ms TTL=128
Reply from 192.168.1.123: bytes=32 time<1ms TTL=128
Reply from 192.168.1.123: bytes=32 time<1ms TTL=128
Reply from 192.168.1.123: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.1.123:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Full Network Discovery
If you need to get the hostnames and other information for all of the PCs on your network, I recommend using Advanced IP Scanner.
The correct command is nbstat Type "nbtstat -a <ip_address>". Note that <ip_address> is the IP address of the computer.
Work great! :))
This command helped me to get the machine name ping -a <IP> works excellent
Thanks
Hate to comment on a post so old, but you may find nslookup to be what you need. Caveat: a DNS server must exist on the network. In a command prompt enter : nslookup xxx.xxx.xxx.xxx (whatever IP address you want) The response if successful: Name: machine name Address: xxx.xxx.xxx.xxx
for some of these and you know DNS is there you could use nslookup instead and get more info from
I am trying this on a domain server and it returns the IP address of whatever I ping, not the computer name. Maybe I am missing something. This is server 2016 and just noticed @gmms comment. Interesting John www.ityoucantrust.com
server 2016 standard only returned the IP address. what if the host-name in the firewall reads "none" does that mean it is being masked, or there just isn't one?
This command helped me to get the machine name ping -a 10.79.211.182
This is fantastic! Helped me immensely! Many thx!!
Thanks godbless dude
Thank you very useful.
Thanks! This solution worked for me!
This worked for me on windows 10 which is connected to a domain thanks a lot
doesnt work in windows 10
This is great! I love you guys for helping me. I did not know how to ping or do any of this stuff. I am learning on the field and the ping command is cool. I built a mexico office with my old computers and proud of it. I love you daddy Diane Huff!
This is great expecially when the DNS cache is out of date. For example today I could not remote into a destination hostname so I used 'ping Office1' which returned an unexpected IP Address then with your help I was able to use ping -a xxx.xxx.xxx.xxx to find a that this is actually a different host 'Office2'. Thg
This command worked for me on Windows 7. Oddly nbtstat -a xxx.xxx.xxx.xxx didn't.
Thank you very useful!
Command does not always work for some devices or on some versions of Windows. Use the following instead, replacing the listed IP with the IP you need to look up: nbtstat -a 192.168.0.0
Awesome, thanks
Thanks...
Thanks
Not Good Answer..
Thanks!!
Thanks worked like a charm
thanks buddy its work
Thank you
Nice one
That usually when the IP is using Linux OS
Same
thanks
does not work, replies with IP only
Thanks for command and advice Advanced IP Scanner
Thank you immensly!