How to Find a Server Name by IP Using the CMD Prompt

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.
Image Credit: Tinpixels/E+/GettyImages

You can find a server name from an IP address using the Windows command prompt. Use the nslookup tool to find the hostname from the IP. You can also use open source tools for similar inquiries or do an online lookup.

Advertisement

Hostnames and IP Addresses

Video of the Day

Every computer accessible through the internet has what's called an internet protocol, or IP, address. The address is a numeric string that computers use to route information to the right place.

Advertisement

Video of the Day

Some computers also have hostnames or domain names. These are human-readable names that identify a server, such as test123.example.com. A network of computers called the Domain Name System exists to translate between domain names and IP addresses. Your web browser, email program and other tools automatically query DNS on your behalf, and you can make your own lookups using command line tools.

Advertisement

Some computers on a local network have local names or IP addresses that aren't accessible outside a network.

Find Computer Name From IP

To use the Windows command prompt to find a computer's name from its IP address, open the command prompt by typing "CMD" in the search box on the taskbar or in the Start Menu.

Advertisement

Then, within the command prompt window, type "nslookup" followed by a space and the IP address you're interested in searching. The tool queries the DNS system to find a name for the computer and displays it.

You can also use nslookup to search for the IP address of a given domain name and for other purposes.

Advertisement

Advertisement

Online Searches for IP

When you want to look up information about an IP address or domain, online tools can deliver the information. Some of these tools access DNS records to find the IP address from a computer name or vice versa. Some look at other databases, called Whois databases, to identify the company or person who owns the IP address or domain name. All of this information is available at no charge, so there's no reason to pay for it.

Advertisement

Some Whois information about domain names is private to avoid spam.

Other Command Line Tools

Nslookup isn't the only command line tool to query DNS information.

Advertisement

Another powerful tool is called "Dig." It's an open source tool that you can download for most modern operating systems, including Windows, macOS and Linux. It has slightly different syntax from nslookup.

Many Unix operating systems ship with Dig, as well as a command line tool called "host" that can translate domain names into IPs and vice versa, similar to nslookup.

Advertisement

Advertisement

references