Ubuntu: find ip address using hostname


I have two linux servers and i'm trying to access them remotely. I know the ip of the first server but i forgot the ip of the other one.

I'm trying to use nslookup, I did

nslookup server2  

and the output was:

Server:  Address:    Non-authoritative answer:  Name:   server2  Address:  

and then i tried to use it again but with server1 and I got the same output...

Anyway, why is the output the same for both server? is nslookup the better option to find out the ip of the other linux server that i have? What other option can I use?


Try using ping instead:

$ ping server2  

nslookup and ping use different techniques for name resolution.

An in-depth explanation for this can be found here: http://cbfive.com/ping-vs-nslookup/

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »