Microsoft DOS nslookup command

nslookup commandAbout nslookup

About nslookup

MS-DOS utility that enables a user to look up an IP address of a domain or host on a network. The nslookup command also allows for a reverse lookup using an IP address to find the domain or host associated with that IP address.

If you are using earlier versions of Microsoft Windows, including Windows 95, Windows 98, or Windows ME, and the options available with the nslookup command are needed, you need to download an alternative, third-party program.


The nslookup command is an external command that is available in the below Microsoft operating systems as nslookup.exe.

Windows NT
Windows 2000
Windows XP
Windows 7
Windows 8
Windows 10

Nlslookup syntax

Windows Vista and later syntax
Windows XP and earlier syntax

Windows Vista and later syntax

nslookup [-opt ...] # interactive mode using default server
nslookup [-opt ...] - server # interactive mode using 'server'
nslookup [-opt ...] host # just look up 'host' using default server
nslookup [-opt ...] host server # just look up 'host' using 'server'

Windows XP and earlier syntax

Commands: (identifiers are shown in uppercase, [] means optional)

NAME print info about the host/domain NAME using default server
NAME1 NAME2 as above, but use NAME2 as server
help or ? print info on common commands
set OPTION set an option

all print options, current server and host
[no]debug print debugging information
[no]d2 print exhaustive debugging information
[no]defname append domain name to each query
[no]recurse ask for recursive answer to query
[no]search use domain search list
[no]vc always use a virtual circuit
domain=NAME set default domain name to NAME
srchlist=N1[/N2/.../N6] set domain to N1 and search list to N1,N2, etc.
root=NAME set root server to NAME
retry=X set number of retries to X
timeout=X set initial time-out interval to X seconds
Type=X set query type (ex. A,ANY,CNAME,MX,NS,PTR,SOA,SRV)
queryType=X same as type
class=X set query class (ex. IN (Internet), ANY)
[no]msxfr use MS fast zone transfer
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

Nslookup examples

This command is often used to perform a reverse lookup on an IP address as shown in the example below. The first section specifies the server and address of that server that provided you with the domain name and IP address displayed in the second section.





Running nslookup without specifying an IP address or domain name displays your router's server and address. To get out of the > prompt, type exit and press Enter.