How to Use NSLookup in Interactive & Non-Interactive Mode

NSLookup stands for “name server lookup” it is one of the important command line tool available in many current operating systems is a way to get basic DNS information in a quick and easy way. NSLookup can be used to check out the following:

  • IP address of a host.
  • The domain name of an IP address.
  • Mail servers for a domain.

The nslookup tool is available only if you have TCP/IP protocol enabled in your operating system. Nslookup command can be used in 2 modes

  • Interactive mode.
  • Non-interactive mode.

To use this command line tool you can press Windows and R key together (Win + R) and type CMD and press enter to open the command prompt. You can also click on start menu and type run and it will show the run program on the top of the list. Click to open it.

From where we can use NSLookup command.

Interactive mode:

To use in interactive mode of NSLookup type nslookp in the command line and press enter.

You should get a nslookup command prompt.

To find out the IP address of a host in interactive mode you have to type the hostname or FQDN (Fully Qualified Domain Name) of a website:

e.g. www.avoiderrors.com

If you want Reverse Lookup from IP address to the domain name you have to provide the IP address

e.g. 159.65.232.110

To find out the Mail Servers for a Domain or a specific location you can use the following command.

Type querytype=mx  “domain name”

Non-Interactive mode:

To use in the non-interactive mode of NSLookup type nslookup with its arguments in the command line to get the results.

To find the IP address of a host in the non-interactive mode you have to type the following command

NSLookup domain name.

To do the Reverse Lookup from IP address to a domain name you have to type the following command

NSLookup IP Address

If you want to find out Mail Servers for a Domain or a specific location you can try the following command

NSLookup  -querytype=mx  domain name

These are some of the basic uses of NSLookup which can help you get DNS related information.

Muhammad Imran Habib

Imran is a technology evangelist with 8 years of experience working with some of the Industry leading companies. Imran's expertise includes On-Prem/Virtual Infrastructure deployments, IT Solutions for SMEs, End User Computing Support.

You may also like...