Personal tools
You are here: Home Members Kevin Hill old-blog Shell Trick of the Day: What Hosts am I?
Error
There was an error while rendering the portlet.
Error
There was an error while rendering the portlet.
Log in


Forgot your password?
 

Shell Trick of the Day: What Hosts am I?

by Kevin Hill — last modified Jul 20, 2007 02:44 PM
Filed Under:

Forget what virtual hosts you have configured on a server? Do you set up reverse DNS properly?

Here's a one liner to get a list of hostnames your server is listening to:

ifconfig -a | grep inet\ addr: | awk '{print $2}' | cut -d : -f 2 | xargs -n1 host | awk '{print $5}'

Works on Linux, should work on most OS's with a little tweaking....


Document Actions
Error
There was an error while rendering the portlet.
Error
There was an error while rendering the portlet.