The primary command for entering Nslookup is:
nslookup
You can either use the command by itself to enter a dedicated command line within the nslookup program or you can enter commands on the same line to return your result and return you to the base command prompt.
For example, Open CMD and then type nslookup:
nslookup
This will return:
Default Server: UnKnown
Address: 10.20.1.1
>
Leaving you at a prompt within nslookup. Here you will be able to see the Default Server name which reflects your DNS server name and Address which reflects your DNS server IP address.
In here, you can type in any hostname for which you would like to get the IP address. Your computer will contact your DNS server to ask for the DNS resolution and will display to you the IP address(es) once it gets an answer. Instead of the hostname, you can also type in the IP Address and your computer will get the hostname for the specified IP and give it to you in the CMD Window.
Alternatively, in CMD window, entering:
nslookup wikipedia.org
Will return:
Server: UnKnown
Address: 10.2.0.1
Non-authoritative answer:
Name: wikipedia.org
Addresses: 2620:0:860:ed1a::1Non-authoritative answer:
Name: wikipedia.org
Addresses: 2620:0:860:ed1a::1
208.80.153.224
208.80.153.224
In this way, you can use the nslookup command-line to get the IP Address using the hostname or vice-versa.