How to use nslookup command (2 examples) - ServiceDesk Plus

How to Use nslookup command?

NSlookup is a command-line tool used for testing and troubleshooting DNS servers. It is one of most powerful and frequently used tools used by Systems and Network Engineers / Administrators. This document will help you use the basic of nslookup command for checking a host name’s IP or IP’s hostname.

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.

                  New to ADSelfService Plus?