Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to get the hostname of a remote server using the IP address using my Ubuntu.

In Windows we can get using NBTSTAT but this doesn't work in Linux.

Does anyone know how to do that?

share|improve this question
up vote 26 down vote accepted

To find a hostname in your local network by IP address you can use:

nmblookup -A <ip>

To find a hostname on the internet you could use the host program:

host <ip>

Or you can install nbtscan by running:

sudo apt-get install nbtscan

And use:

nbtscan <ip>
share|improve this answer
it said no reply from but ping is able to communicate with server – OmiPenguin Oct 23 '12 at 9:27
In that case, try host. – Silke Oct 23 '12 at 9:28
ok now i used host ipaddress, It replied Host not found: 3(NXDOMAIN) – OmiPenguin Oct 23 '12 at 9:35
Is the server in your local network or is it a public IP address? – Silke Oct 23 '12 at 9:37
Yes this is in our local Network. – OmiPenguin Oct 23 '12 at 9:54

simply type the following command in the terminal:

host <ip>
share|improve this answer

Just another minor addition to others contribution, in case you don't know the IP.

If you don't know your then type:

sudo ifconfig -all

You may find the there. Then, all you need to do is use the:

 host <ip> 

command as mentioned before.

Although this is a already answered question, I may found useful add this simple hint to ubuntu-linux newcomers.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.