DOS command: nslookup

nslookup is a command line program which allows a user to determine an IP address from a DNS name, and a DNS name from an IP address.

nslookup [ip-address | domain]
  • nslookup
  • nslookup
  • nslookup
If you only enter command nslookup (not followed by ip-address or domain name), a prompt ">" will be displayed. You can enter the below mentioned commands. Please note the following:
  • NAME - print info about the host/domain NAME using default server
  • NAME1 NAME2 - as above, but use NAME2 as server
  • [] - means optional

Command Description
help | ? Print info on common commands.
set all Print options, current server and host.
set [no]debug Print debugging information
set [no]d2 Print exhaustive debugging information.
set [no]defname Append domain name to each query.
set [no]recurse Ask for recursive answer to query.
set [no]search Use domain search list.
set [no]vc Always use a virtual circuit.
set domain=NAME Set default domain name to NAME.
set srchlist=N1[/N2/.../N6] Set domain to N1 and search list to N1,N2, etc.
set root=NAME Set root server to NAME.
set retry=X Set number of retries to X.
set timeout=X Set initial time-out interval to X seconds.
set type=ResourceRecordType


set q[uerytype]=ResourceRecordType
The ResourceRecordType specifies a DNS resource record type. The default resource record type is A. The following table lists the valid values for this command:

A Specifies a computer's IP address.
ANY Specifies all types of data.
CNAME Specifies a canonical name for an alias.
GID Specifies a group identifier of a group name.
HINFO Specifies a computer's CPU and type of operating system.
MB Specifies a mailbox domain name.
MG Specifies a mail group member.
MINFO Specifies mailbox or mail list information.
MR Specifies the mail rename domain name.
MX Specifies the mail exchanger.
NS Specifies a DNS name server for the named zone.
PTR Specifies a computer name if the query is an IP address; otherwise, specifies the pointer to other information.
SOA Specifies the start-of-authority for a DNS zone.
TXT Specifies the text information.
UID Specifies the user identifier.
UINFO Specifies the user information.
WKS Describes a well-known service.

set class=X Set query class (ex. IN (Internet), ANY).
set [no]msxfr Set MS fast zone transfer.
set ixfrver=X Current version to use in IXFR transfer request.
server NAME Set default server to NAME, using current default server.
lserver NAME Set default server to NAME, using initial server.
finger [USER] finger the optional NAME at the current default host.
root Set current default server to the root.
ls [opt] DOMAIN [> FILE] list addresses in DOMAIN (optional: output to FILE)
  • -a       list canonical names and aliases
  • -d       list all records
  • -t       TYPE list records of the given type
             (e.g. A,CNAME,MX,NS,PTR etc.)
view FILE Sort an 'ls' output file and view it with pg.
exit Exit the program.

Example: Checking a webserver
  1. Open a DOS window.

  2. Type: ping

    The ip address will be returned:

  3. Type: nslookup

    You will see:

    *** Can't find server name for address Non-existent domain
    *** Default servers are not available
    Default Server: UnKnown


  4. Type: server

    You will see:

    Default Server: []

  5. Type: set q=SOA
  6. Type:

    You will see:

    Server: []
          primary name server =
          responsible mail addr =
          serial = 2006031000
          refresh = 7200 (2 hours)
          retry = 3600 (1 hour)
          expire = 1209600 (14 days)
          default TTL = 86400 (1 day) nameserver = nameserver = internet address = internet address =