October 04, 2005

How to get the hostname from an IP

This might not be the most efficient way, but it is satisfying, for me at least:
nslookup 10.0.0.1 | grep "Name:" | awk '{print $2}'

Posted by stuartcw at October 4, 2005 11:27 AM
Comments

host -t ptr 10.0.0.1 | awk '{print $5}'

Posted by: Stefano at October 5, 2005 12:42 PM