Displays information that you can use to diagnose Domain Name System (DNS) infrastructure. Before using this tool, you should be familiar with how DNS works. The Nslookup command-line tool is available only if you have installed the TCP/IP protocol.
nslookup [-SubCommand ...] [{ComputerToFind| [-Server]}]
-SubCommand ... : Specifies one or more nslookup subcommands as a command-line option. For a list of subcommands, see Related Topics.
ComputerToFind : Looks up information for ComputerToFind using the current default DNS name server, if no other server is specified. To look up a computer not in the current DNS domain, append a period to the name.
-Server : Specifies to use this server as the DNS name server. If you omit -Server, the default DNS name server is used.
{help|?} : Displays a short summary of nslookup subcommands.
| • | If ComputerToFind is an IP address and the query is for an A or PTR resource record type, the name of the computer is returned. If ComputerToFind 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 following set subcommands: domain, srchlist, defname, and search. | ||||||||||||||||||
| • | If you type a hyphen (-) instead of ComputerToFind, the command prompt changes to nslookup interactive mode. | ||||||||||||||||||
| • | The command-line length must be less than 256 characters. | ||||||||||||||||||
| • | Nslookup has two modes: interactive and noninteractive. If you need to look up only a single piece of data, use noninteractive mode. For the first parameter, type the name or IP address of the computer that you want to look up. For the second parameter, type the name or IP address of a DNS name server. If you omit the second argument, nslookup uses the default DNS name server. If you need to look up more than one piece of data, you can use interactive mode. Type a hyphen (-) for the first parameter and the name or IP address of a DNS name server for the second parameter. Or, omit both parameters and nslookup uses the default DNS name server. Following are some tips about working in interactive mode:
| ||||||||||||||||||
| • | If the lookup request fails, nslookup prints an error message. The following table lists possible error messages.
| ||||||||||||||||||
| • | For more information about the nslookup command and DNS, see the following resources:
|
Each command-line option consists of a hyphen (-) followed immediately by the command name and, in some cases, an equal sign (=) and then a value. For example, to change the default query type to host (computer) information and the initial time-out to 10 seconds, type:
nslookup -querytype=hinfo -timeout=10
| Format | Meaning |
Italic | Information that the user must supply |
Bold | Elements that the user must type exactly as shown |
Ellipsis (...) | Parameter that can be repeated several times in a command line |
Between brackets ([]) | Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one |
Courier font | Code or program output |