I have used arp-scan in terminal to get the ipaddress as well as mac address, is there anyway i can get to know the hostname of the ipaddress that are there in the terminal? for example there are A-pc and B-pc and C-pc connected to the same router. I need to get the hostname the same way i got the result in arp-scan. Is there any command? please reply to this. Thank you.

PS: I dont want to use wireshark or any other s/w. It would be helpful if there was a terminal command.


try nslookup

Note: All tools require a DNS that have a reverse lookup zone. (the default is forward lookup zone only). This is why it will work on most external domains (internet) because they are registered in DNS all over the internet. for internal network you need an internal DNS reverse lookup server. check the following link


Assuming you have a local DNS server set up, dig should do

dig +short -x 123.456.789.12

(Yes, that's not a valid IP, it's a Hollywood IP)


To get the hostname from the IP address. The simplest way is to use the “host” utility . Just run…

# host
output is: # domain name pointer jc-in-f99.google.com.

This will query the name server and provide you with the hostname of the IP address.By default it will query the nameserver listed in the /etc/resolv.conf file.

  • i saw this in some site, but this doesnt give you the details of the pc connected to my modem/router right? like i am at and i cant know a pc at – thanmai Sep 26 '12 at 10:55
  • 1
    No , you can know but you must have a DNS rsolver. In the output you can see that it gives the hostname of the ip which belongs to google – user61928 Sep 26 '12 at 10:57

I'm assuming you want the netbios name?

sudo apt-get install nbtscan
echo will scan: $(hostname -I | cut -d ' ' -f 1)/24
nbtscan $(hostname -I | cut -d ' ' -f 1)/24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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