Wednesday, July 18, 2007

Quick NSlookup commands

If you are wondering how to use the NSLookup tool it is quite handy.

The tool is used from the command prompt and can be used to determine the name of your DNS server. Often used by us I.T support Engineers/professionals/guys whatever you want to call us to troubleshoot DNS problems. So to use NSlookup simply go to a command prompt and type:


this should give you the IP address of all the DNS servers that you are using on your computer to resolve IP address from domain names, see below

C:\Documents and Settings\rajk>nslookup
*** Can't find server name for address Non-existent domain
*** Default servers are not available
Default Server: UnKnown


At the next prompt type ? (this will give you all the commands that you can use), see the list below

> ?
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


To see how you can get mx records for a domain please see my posting called Using NSLookup to find mx records

If for some reason you

No comments: