From aldeid
Jump to navigation Jump to search


nslookup is an interactive tool for testing and troubleshooting DNS servers.


Non-interactive mode

$ nslookup somesite.com

Non-authoritative answer:
Name:	somesite.com

Interactive mode


host <server>
Look up information for host using the current default server or using server, if specified. If host is an Internet address and the query type is A or PTR, the name of the host is returned. If host is a name and does not have a trailing period, the search list is used to qualify the name.
To look up a host not in the current domain, append a period to the name.
> aldeid.com

Non-authoritative answer:
Name:	aldeid.com
server <domain>
Changes default server to be used for queries
> server
Default server: somesite.com
lserver <domain>
Change the default server to domain; lserver uses the initial server to look up information about domain, while server uses the current default server. If an authoritative answer can't be found,the names of servers that might have the answer are returned.
Quits the program
set keyword[=value]
This command is used to change state information that affects the lookups. Valid keywords are:


All of these keywords are modified using following syntax:

set keyword[=value]

For example:

set querytype=ns
Prints the current values of the frequently used options to set. Information about the current default server and host is also printed.
Change the query class to one of
  • IN: The Internet class (default class)
  • CH: The Chaos class
  • HS: The Hesiod class
  • ANY: wildcard
Turn on or off the display of the full response packet and any intermediate response packets when searching.
(Default = nodebug; abbreviation = [no]deb)
Turn debugging mode on or off. This displays more about what nslookup is doing.
(Default = nod2)
Sets the search list to name.
If the lookup request contains at least one period but doesn't end with a trailing period, append the domain names in the domain search list to the request until an answer is received.
Change the default TCP/UDP name server port to value.
(Default = 53; abbreviation = po)
Change the query type (ns, a, ...)
> set querytype=mx
> google.com

Non-authoritative answer:
google.com	mail exchanger = 40 alt3.aspmx.l.google.com.
google.com	mail exchanger = 30 alt2.aspmx.l.google.com.
google.com	mail exchanger = 20 alt1.aspmx.l.google.com.
google.com	mail exchanger = 50 alt4.aspmx.l.google.com.
google.com	mail exchanger = 10 aspmx.l.google.com.

Authoritative answers can be found from:
google.com	nameserver = ns3.google.com.
google.com	nameserver = ns2.google.com.
google.com	nameserver = ns1.google.com.
google.com	nameserver = ns4.google.com.
aspmx.l.google.com	internet address =
ns2.google.com	internet address =
ns1.google.com	internet address =
ns3.google.com	internet address =
ns4.google.com	internet address =
Change the type of the information query.
(Default = A; abbreviations = q, ty)
Tell the name server to query other servers if it does not have the information.
(Default = recurse; abbreviation = [no]rec)
Set the number of retries to number.
Set the number of retries to number.
Change the initial timeout interval for waiting for a reply to number seconds.
Always use a virtual circuit when sending requests to the server.
(Default = novc)
Try the next nameserver if a nameserver responds with SERVFAIL or a referral (nofail) or terminate query (fail) on such a response.
(Default = nofail)