Knowledgebase: Dedicated Servers
Using the nslookup command
Posted by Muslim KHAN on 26 September 2016 10:06 AM

nslookup is a command which can be used to troubleshoot DNS issues.

You can use the nslookup command interactively from which you can change servers, set query options, and debug DNS.

You can also use nslookup non-interactively from the command line to issue simple queries.

Using nslookup interactively

   1. Enter nslookup at the command line. The nslookup prompt appears.

   2. View the current options by entering set all.

   3. Change any desired options by entering set option.

   4. Issue nslookup commands.

   5. Enter exit to leave nslookup.

nslookup interactive commands

These sample commands are available from the nslookup shell:

domain.com
    Return the IP address of domain.com.

127.0.0.1
    Return the name matching the IP address you enter.

set querytype=ns
    Set the query type to the Name Server record. Future queries of names and IP addresses return the NS record from that host.

set querytype=a
    Restore the query type to the Address record.

server ns.domain.com
    Changes the default DNS server or the server which is is queried.

Querying a single name or address

To issue a simple query from the command line, use one of the following forms of the command:

nslookup name

nslookup IP_address

nslookup should return the desired answer by querying the default server. To query a different server, enter one of the following forms of the command:

nslookup name server

nslookup IP_address server