Get a computer address from IP address in a LAN: command prompt
This article explains how to find out the hostname of a computer connected to a local network using the IP address. Depending on the type of IP address - public or private - there are two different procedures. Here we will give an easy hint on how to do this.
How to find a hostname via public IP address?
In order to find the hostname of a computer with a public IP address, you have to pass the address to the Domain Name System (DNS) server. Here are the steps to follow:
- Click on the Window Start button.
- Click on “All Programs”.
- Click on “Accessories”.
- Right-click on "Command Prompt".
- Choose "Run as Administrator".
- Type “nbtstat -a <ip_address>”. Note that <ip_address> is the IP address of the computer.
How to find a hostname via private IP address?
Finding the hostname of a computer with a private IP address and no local DNS server means you need to query the host itself by using a Windows utility. Here are the steps to follow:
- Click on the Window Start button.
- Click on “All Programs”.
- Click on “Accessories”.
- A black box opens.
- Type "nslookup -a <ip_address>". Note that <ip_address> is the IP address of the computer.
Note that it is not necessary to know an IP address in order to find other systems if you have a WiFi LAN connection.
We hope that you find these solutions useful and that your question is answered!