Finding a hostname from an ip address

At my workplace, I’ve set up an FTP server so that colleagues from across the globe can download some files that I make available for them. I noticed that two people in the same office were downloading the exact same file (10 GB in size) except one was about 10% complete while the other was about 95% complete. I wanted to find out their computer hostnames – usually just an abbreviation of their real names – so that I could let them know that they were both downloading the same file.

I always knew about the ping and nslookup commands. But none these commands would always give me the correct hostname when supplied with an ip address.

For example:
ping - a <ip_address> 
nslookup -a <ip_address>

While these commands worked for fixed ip addresses, they never seemed to work for dynamic ip addresses, and would always return a dhcp-created hostname, rather than the actual hostname of the machine.

I was delighted when I discovered a command that worked for all cases:
nbtstat -A <ip_address>

This command actually gave me a list of all the network adapters that the host contained. The Local Area Connection adapter had the actual hostname that I was looking for.

Warning: Missing argument 1 for cwppos_show_review(), called in /var/www/ on line 29 and defined in /var/www/ on line 18

Leave a Reply

Your email address will not be published. Required fields are marked *