H3XED

How to get Networked Computer Name from IP Address on a LAN

Mar 13, 2015   Windows   Nick Vogt   Comments (18)
Please note that this post is over a year old and may contain outdated information.
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).

How To Open Windows 7 Command Prompt

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


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.
Share This Post
Twitter
Networking
Best Selling Routers
Best Selling Routers
See More Details
Best Selling NAS
Best Selling NAS
See More Details
Networking for Dummies
Networking for Dummies
See More Details
Cat 6 Patch Cable 5-Pack
Cat 6 Patch Cable 5-Pack
See More Details

Comments (18)

Stephen   Oct 17, 2018
This command worked for me on Windows 7. Oddly nbtstat -a xxx.xxx.xxx.xxx didn't.
Andrie   Aug 08, 2018
Thank you very useful!
That Guy   Aug 03, 2018
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
kadettilac   Jun 14, 2018
Awesome, thanks
Hedy   May 26, 2018
Thanks...
Tushar more   Apr 30, 2018
Thanks
Pavan Amaze   Mar 15, 2018
Not Good Answer..
Ritch   Mar 07, 2018
Thanks!!
Mavado   Mar 07, 2018
Thanks worked like a charm
Sentpaoul   Feb 04, 2018
thanks buddy its work
Mo   Dec 29, 2017
Thank you
Rory Kelleher   Jul 03, 2017
Nice one
Andile Solution-Provider Simelane   Jun 06, 2017
That usually when the IP is using Linux OS
Greg Miller   Apr 19, 2017
Same
David Fenton   Mar 30, 2017
thanks
Sasha Bond   Jan 31, 2017
does not work, replies with IP only
Muhammad Tahir Khan   Jan 08, 2017
Thanks for command and advice Advanced IP Scanner
Jazmin Aych   Jan 14, 2016
Thank you immensly!
Share This Post
Twitter
Networking
Best Selling Routers
Best Selling Routers
See More Details
Best Selling NAS
Best Selling NAS
See More Details
Networking for Dummies
Networking for Dummies
See More Details
Cat 6 Patch Cable 5-Pack
Cat 6 Patch Cable 5-Pack
See More Details
H3XED © Nick Vogt   RSS   Policies   Twitter