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 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.

share|improve this question

4 Answers 4

up vote 4 down vote accepted

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

share|improve this answer

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)

share|improve this answer

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
share|improve this answer

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

# host 64.233.187.99
output is: #99.187.233.64.in-addr.arpa 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.

share|improve this answer
    
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 192.168.1.2 and i cant know a pc at 192.168.1.3 –  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

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.