IP2Host: Get Hostname from IP – Command Line

A reverse name resolution zone file is used to translate an IP address in a particular namespace into a fully qualified domain name (FQDN).

If this file has been configured on a name server, it becomes possible to find a hostname from an IP address.

This note shows how to get a hostname from an IP address from the command line in Windows, Linux or MacOS using the nslookup command.

Cool Tip: How to setup a reverse name resolution! Read more →

Find Hostname from IP

Execute the nslookup command as follows from a terminal in Linux/MacOS or from a command prompt (CMD or PowerShell) in Windows to find the hostname by IP:

$ nslookup
- sample output -
Server:  router.net.infra

Name:    my-box-hostname.net.infra

The command above performs the reverse lookup and converts the IP address to hostname by querying the name server for the record.

Was it useful? Share this post with the world!

Leave a Reply