Not sure if I understood your question.
If it is resolve IP for given hostname then you just make a host <fqdn of server>
. The host command resolves forward and reverse queries so you can also do a host <IP of interest>
and you will get a FQDN hostname as answer. You could use nslookup
, dig
and even ping
(just to mention some other) but host is my personal fav as it gives minimum information of the connection between IP and server name.
Be aware that using ping <FQDN>
could be resolved different than host
(which makes a DNS query) and ssh
and ping
will (on most default network setups) go to the hosts file first.
That means - if you have an entry in /etc/hosts
which points 192.168.1.100 to some.server.com, ssh some.server.com
will try to connect to this IP and not the one you would get from DNS (in case they differ).
Another thing to be aware of, the host IP does not have to match the host FQDN, eg. I use a hosting service and when I do host FQDN and then use the IP from the answer in host IP - I will NOT get my FQDN - instead I will get the FQDN of the hosting server (as my FQDN is an alias for the hosting server).
And to make this even a little bit more confusing :)
If I ping www.google.com
I get a 159.... IP, and with dig www.google.com
I get 15 IPs all starting with 212.
This just that you be aware that the name to IP resolving depends firstly of the command/application being used and then some OS networking setup and more...