Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • on my ubuntu, hostname -i print IP adress corresponding to hostname. Commented Jul 6, 2015 at 11:20
  • Yes that's right , so I pass this IP to host command . This will get you something like this: YOUR_IP.in-addr.arpa domain name pointer hostname.domainname. with awk I get the last column which is hostname.domainname Commented Jul 6, 2015 at 13:57
  • I see, unfortunatly using host $(hostname -i) give me a list of 8 hostname, all with same IP, and no hostname corresponding to my hosts Commented Jul 6, 2015 at 14:01
  • are you sure you do not have any aliases for host command? it seems that your command host has an alias to host -a Commented Mar 19, 2016 at 13:06