I have a Linux box and I know I can get the list of IP addresses assigned to that box using following command /sbin/ifconfig -a
but how to I get the list of hostnames / DNS for that Linux box using single command?
Why I asking this is because using /sbin/ifconfig -a
I see that there are ~6 ethernets connected to it and in those 4 are active. Now, all those have different IP addresses, so I have 4 different IP addresses for my Linux box (please correct me if I am wrong here ??). Now, my Weblogic application server has defined listen address as, lets say abc.fb.us
and xyz.fb.us
etc. Now when I ping each hostname (should I call abc.fb.us
as hostname or DNS or alias ??) then I get some IP address which is listed when I do ifconfig
.
I know I can do nslookup 172.22.33.11
and I will get abc.fb.us
, assuming that's the IP address of abc.fb.us
.
But I want to get a list of hostnames using single command, much like the way I got list of IP address.
I have checked my /etc/hosts
and it doesn't have abc.fb.us
, xyz.fb.us
etc. so clearly there is some other way these names are configured and how do I get all the hostnames?