nslookup |
Diagnostic utility that displays information stored in DNS servers.
nslookup has two modes of operation:
In this mode, an nslookup shell is opened so that any sequence of nslookup commands can be run one at a time. Enter interactive mode by typing:
nslookup
In this mode, only a single nslookup command is run, after which you return to the command prompt. The syntax is:
nslookup - command host DNSserver
One of the nslookup commands in the following list. The hyphen is part of the syntax.
The IP address or hostname of the host whose DNS information you want to obtain from the DNS server. If you use a hyphen, the prompt changes to nslookup interactive mode.
The IP address or hostname of the DNS server you want to query. (If omitted, the default DNS server for the local machine is used.)
Quits the interactive mode of nslookup .
Fingers the current computer for a list of currently logged-on users. If you specify username, then the information for that user is obtained.
Lists (or redirects to a file) different subsets of resource records for the specified DNS domain depending on the option selected, specifically :
Lists all records of the specified type (see Table 5-22)
Lists aliases of hosts in the DNS domain (same result as using -t CNAME )
Lists all records for the DNS domain (same result as using -t ANY )
Lists operating-system information for the DNS domain (same result as using -t HINFO )
Lists well-known services of host in the DNS domain (same result as using -t WKS )
Sets the default server to the specified DNS domain using the initial server.
Sets the default server to the DNS root server ns.nic.ddn.mil (same result as using lserver ns.nic.ddn.mil ). Use set root to change the default root server.
Sets the default server to the specified DNS domain using the current default server.
Displays the configuration of nslookup (how it performs lookups).
Modifies the query class, which can be IN (Internet class), CHAOS (Chaos class), HESIOD (MIT Athena Hesiod class), or ANY (any class). The default is IN (the other classes are obsolete).
Enables or disables exhaustive debugging mode, which is incredibly verbose (default is no ).
Enables or disables debugging mode, which is very verbose (default is no ).
Appends the default DNS domain name to each query (default is yes ).
Switches the default DNS domain to the one specified. This name is appended to all nslookup queries if defname is specified.
Reports or ignores packet errors (default is ignore ).
Modifies the default TCP/UDP port for the DNS name server port. (This is port 53 by default.)
Specifies the types of resource records to obtain from the DNS server (see Table 5-22). The default is Address (A) record.
Enables or disables recursion, i.e.,whether the DNS server should query other DNS servers if it can't respond with the requested information. (Default is yes .)
Specifies the number of retries that can be performed by nslookup when querying a DNS server until it gives up (default is four times).
Specifies the root server (affects the root command earlier in this list). The default is ns.nic.ddn.mil .
Toggles whether each DNS domain name in the search list should be appended to a request until a response is received (default is yes).
Specifies the DNS domain name search list (up to six DNS servers can be specified).
Modifies the initial time in seconds that nslookup waits for a response to its first request (default is five seconds).
Specifies the type of records to be requested from a DNS server (see Table 5-22).
Specifies that a virtual circuit should be used when sending requests to a DNS server (default is no ).
Displays the output of any previous commands that have been redirected to files.
Value | Description |
---|---|
A | Computer's IP address |
ANY | All types of data |
CNAME | Canonical name for an alias |
GID | Group identifier of a group name |
HINFO | Computer's CPU and operating-system type |
MB | Mailbox domain name |
MG | Mail group member |
MINFO | Mailbox or mail-list information |
MR | Mail rename domain name |
MX | Mail exchanger |
NS | DNS name server for the named zone |
PTR | Hostname (if the query is an IP address) or pointer to other info |
SOA | DNS domain's start-of-authority record |
TXT | Text information |
UID | User identifier |
UINFO | User information |
WKS | Well-known service description |
Start nslookup in interactive mode:
C:\> nslookup Default Server: izzy.mtitworld.com Address: 172.16.11.99 >
Switch default DNS server to BACH :
> server bach.mtitworld.com Default Server: bach.mtitworld.com Address: 172.16.11.100
Specify that only Address (A) records should be queried:
> set query=A
Resolve host BEETHOVEN in domain mtitworld.com into its IP address:
> beethoven.mtitworld.com Server: bach.mtitworld.com Address: 172.16.11.100 Name: beethoven.mtitworld.com Address: 172.16.11.101
Query default DNS server for all records in its database:
> ls mtitworld.com [bach.mtitworld.com] mtitworld.com. A 172.16.11.100 mtitworld.com. NS server=bach.mtitworld.com gc._msdcs A 172.16.11.105 gc._msdcs A 172.16.11.103 gc._msdcs A 172.16.11.104 gc._msdcs A 172.16.11.100 bach A 172.16.11.100 beethoven A 172.16.11.101 chopin A 172.16.11.102 distrib A 172.16.11.103 franck.distrib A 172.16.11.103 handel A 172.16.11.70 chopin.vancouver A 172.16.11.102
nslookup commands must be 255 or fewer characters .
To look up a computer not in the current DNS domain, append a period to the name. For example, type beethoven.otherdomain.com. at the interactive nslookup prompt.
Use exit or Ctrl-C to escape from an nslookup session.
An unrecognized command is interpreted as a hostname.
For more information on using nslookup , see DNS on Windows Server 2003 (O'Reilly).
DNS