Home > Commands N-Z > Commands N

NSLOOKUP


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

This diagnostic tool displays information from Domain Name System (DNS) name servers. Before using this tool, you should be familiar with how DNS works. Available only if the TCP/IP protocol has been installed.

If you need to look up only a single piece of data, use noninteractive mode. For the first argument, type the name or IP address of the computer to be looked up. For the second argument, type the name or IP address of a DNS name server. If you omit the second argument, the default DNS name server is used.

If you need to look up more than one piece of data, you can use interactive mode. Type a hyphen (-) for the first argument and the name or IP address of a DNS name server for the second argument. Or, omit both arguments and the default DNS name server is used.


Syntax

NSLOOKUP [-help | -?]

NSLOOKUP -exit [computer_to_find | - ] [server]

NSLOOKUP -finger [username] [[> | >>] filename] [computer_to_find | - ] [server]

NSLOOKUP -ls [-t querytype] [-a] [-d] [-h] [-s] dnsdomain [[> | >>] filename] [computer_to_find | - ] [server]

NSLOOKUP -lserver dnsdomain [computer_to_find | - ] [server]

NSLOOKUP -root [computer_to_find | - ] [server]

NSLOOKUP -server dnsdomain [computer_to_find | - ] [server]

NSLOOKUP -set all [computer_to_find | - ] [server]

NSLOOKUP -set cl[ass]=value [computer_to_find | - ] [server]

NSLOOKUP -set [no]deb[ug] [computer_to_find | - ] [server]

NSLOOKUP -set [no]d2 [computer_to_find | - ] [server]

NSLOOKUP -set [no]def[name] [computer_to_find | - ] [server]

NSLOOKUP -set do[main]=value [computer_to_find | - ] [server]

NSLOOKUP -set [no]ig[nore] [computer_to_find | - ] [server]

NSLOOKUP -set po[rt]=value [computer_to_find | - ] [server]

NSLOOKUP -set q[uerytype]=value [computer_to_find | - ] [server]

NSLOOKUP -set [no]rec[urse] [computer_to_find | - ] [server]

NSLOOKUP -set ret[ry]=value [computer_to_find | - ] [server]

NSLOOKUP -set ro[ot]=value [computer_to_find | - ] [server]

NSLOOKUP -set [no]sea[rch] [computer_to_find | - ] [server]

NSLOOKUP -set srchl[ist] name/name/... [computer_to_find | - ] [server]

NSLOOKUP -set ti[meout]=value [computer_to_find | - ] [server]

NSLOOKUP -set ty[pe]=value [computer_to_find | - ] [server]

NSLOOKUP -set [no]v[c] [computer_to_find | - ] [server]

NSLOOKUP -view filename] [computer_to_find | - ] [server]


Parameters
computer_to_find (NT4)
Looks up information for computer_to_find using the current default server or using server if specified. If computer_to_find is an IP address and the query type is A or PTR, the name of the computer is returned. If computer_to_find is a name and does not have a trailing period, the default DNS domain name is appended to the name. This behavior depends on the state of the set options: domains, srchlist, defname, and search. To look up a computer not in the current DNS domain, append a period to the name. If you type a hyphen (-) instead of computer_to_find, the command prompt changes to interactive mode.
server (NT4)
Specifies to use this server as the DNS name server. If omitted, the default DNS name server is used.

Switches
-help | -? (NT4)
Brief command summary.
-exit (NT4)
Exit command.
filename (NT4)
Specifies a file name in which to save the output. You can use the greater than (>) and double greater than (>>) characters to redirect the output in the usual manner.
-finger (NT4)
Connects with the finger server on the current computer. The current computer is defined when a previous lookup for a computer was successful and returned address information. See set querytype=A command.
username (NT4)
Specifies the name of the user to look up.
-ls (NT4)
Lists information for a DNS domain. The default output contains computer names and their IP addresses. When output is directed to a file, hash marks are printed for every 50 records received from the server.
-a (NT4)
Lists aliases of computers in the DNS domain (-t CNAME).
-d (NT4)
Lists all records for the DNS domain (-t ANY).
dnsdomain (NT4)
Specifies the DNS domain for which you want information.
-lserver (NT4)
Changes the default server to the specified DNS domain. The lserver command uses the initial server to look up the information about the specified DNS domain. This is in contrast to the server command, which uses the current default server.
dnsdomain (NT4)
Specifies the new DNS domain for the default server.
-h (NT4)
Lists CPU and operating system information for the DNS domain (-t HINFO).
-s (NT4)
Lists well-known services of computers in the DNS domain (-t WKS).
-t querytype (NT4)
Lists all records of the specified type. For a description of querytype, see set querytype.
-root (NT4)
Changes the default server to the server for the root of the DNS domain name space. Currently, the computer ns.nic.ddn.mil is used. This command is a synonym for lserver ns.nic.ddn.mil. You can change the name of the root server with the set root command.
-server (NT4)
Changes the default server to the specified DNS domain. The server command uses the current default server to look up the information about the specified DNS domain. This is in contrast to the lserver command, which uses the initial server.
-set all (NT4)
Prints the current values of the configuration settings. Also prints information about the default server and computer (host).
-set cl[ass]=value (NT4)
Changes the query class. The class specifies the protocol group of the information.
-set [no]deb[ug] (NT4)
Turns debugging mode on or off (default). With debugging on, more information is printed about the packet sent to the server and the resulting answer.
-set [no]d2 (NT4)
Turns exhaustive debugging mode on or off (default). All fields of every packet are printed.
-set [no]def[name] (NT4)
Appends the default DNS domain name to a single component lookup request. A single component is a component that contains no periods. Default defname.
-set do[main]=value (NT4)
Changes the default DNS domain to the name specified. The default DNS domain name is appended to a lookup request depending on the state of the defname and search options. The DNS domain search list contains the parents of the default DNS domain if it has at least two components in its name. Use the set srchlist command to specify a different list. Use the set all command to display the list.
Value specifies a new name for the default DNS domain (default value from hostname).
-set [no]ig[nore] (NT4)
Ignores packet truncation errors. Default noignore.
-set po[rt]=value (NT4)
Changes the default TCP/UDP DNS name server port to the value specified (default 53).
-set q[uerytype]=value (NT4)
-set ty[pe]=value (NT4)
Changes the type of information query. More information about types can be found in Request For Comment (RFC) 1035. The set type command is a synonym for set querytype.
-set [no]rec[urse] (NT4)
Tells the DNS name server to query other servers if it does not have the information. Default recurse.
-set ret[ry]=value (NT4)
Sets the number of retries (default 4). When a reply to a request is not received within a certain amount of time (changed with set timeout), the time-out period is doubled and the request is resent. The retry value controls how many times a request is resent before giving up.
-set ro[ot]=value (NT4)
Changes the name of the root server (default ns.nic.ddn.mil). This affects the root command.
-set [no]sea[rch] (NT4)
If set and the lookup request contains at least one period but does not end with a trailing period, append the DNS domain names in the DNS domain search list to the request until an answer is received. Default search.
-set srchl[ist] (NT4)
Changes the default DNS domain name and search list. Overrides the default DNS domain name and search list of the set domain command. Use the set all command to display the list.
name/name/... (NT4)
Specifies new names for the default DNS domain and search list. You can specify a maximum of six names separated by slashes (/). Default value based on hostname.
-set ti[meout]=value (NT4)
Changes the initial number of seconds to wait for a reply to a request (default 5). When a reply to a request is not received within this time period, the time-out is doubled and the request is resent. The number of retries is controlled with the set retry option.
-set [no]v[c] (NT4)
Indicates to always use a virtual circuit when sending requests to the server. Default novc.
-view filename (NT4)
Sorts and lists the output of previous ls command or commands (reads from filename).

Related

none.


Notes

none.


Examples

Change the default query type to host (computer) information and the initial time-out to 10 seconds:

    nslookup -querytype=hinfo -timeout=10

Errorlevels

none.


Availability
External
DOS
none
Windows
none
Windows NT
NT4 NT2000 NTXP NT2003