Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

up vote 14 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
1  
it said no reply from xxx.xx.xx.xxx but ping is able to communicate with server –  OmiPenguin Oct 23 '12 at 9:27
2  
In that case, try host. –  Silex Oct 23 '12 at 9:28
1  
ok now i used host ipaddress, It replied Host xxx.xx.xx.xxx.in-addr.arpa. not found: 3(NXDOMAIN) –  OmiPenguin Oct 23 '12 at 9:35
1  
Is the server in your local network or is it a public IP address? –  Silex Oct 23 '12 at 9:37
1  
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

Your Answer

 
discard

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.