Ubuntu: find ip address using hostname



Question:

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:         192.168.2.1  Address:        192.168.2.1#53    Non-authoritative answer:  Name:   server2  Address: 90.222.143.15  

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?


Solution:1

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
Previous
Next Post »