Last update: 2021-03-01
Using the NSLOOKUP Command Line Mode
NSLOOKUP – set_subcommand 1 domain_address domain name server address server name 2
Starting an interactive NSLOOKUP session
NSLOOKUP – set_subcommand 1 server address server name 2
Using NSLOOKUP interactive session mode
Enter interactive_subcommand set set_subcommand 2
- 1 Spaces are not allowed between the hyphen (-) and the set subcommand.
- 2 NSLOOKUP operands and subcommands are case-sensitive and must be typed in lowercase. Operand and subcommand values and domain names are not case sensitive.
Use the NSLOOKUP command to issue a single nameserver query in command-line mode or multiple nameserver queries in interactive session mode.
operands set_subcommand Specifies a set NSLOOKUP subcommand. For available set subcommands ,see NSLOOKUP set Subcommands. interactive_subcommand Specifies an NSLOOKUP interactive session subcommand. For the available interactive session subcommands, domain_address Reverses the address components and generates a pointer type request (PTR) to the nameserver to map in-addr.arpade IP6.arpadomain from the address to a name of domain. domain_name Queries the name server for information about domain_name using the current query type. The default request type is A (address request). server address Specifies the Internet address of the name server to query other than the default name server. Initially, an address lookup is performed on the in-addr.arpao IP6 domain. arpaal default name server to map the Internet address on a domain name for the server. server_name Directs the default name server to map server_name to an Internet address, then uses the name server at that Internet address. Notes on use
- You must specify the host name or internet address of the host on which the agent is running, and the community name to use. The community name used for a SET request is usually different from the community name for a GET request. You must specify the names and values for each variable to configure. RFC 1156 and RFC 1158 define which variables you can configure with read and write access. Additionally, there may be company-specific variables defined by the implementer of a particular SNMP agent.
- If the NSLOOKUP ENV file exists, set subcommands are read from the file and executed before any queries are executed. For more information about configuring NSLOOKUP internal state information using the NSLOOKUP ENV file, see NSLOOKUP Internal State Information.
- NSLOOKUP interprets typing or syntax errors as queries. This results in sending a request and displaying the response from the nameserver. The response is usually Domain does not exist, indicating that the server could not find a match for the query.
- A timeout occurs if the name server is not running or cannot be reached.
- Domain does not exist fails if a resource record type for the specified domain name is not available on the name server.
- Server Fail fails when the local name server cannot communicate with the remote name server.
- NSLOOKUP performs a search for the specified domain. The request requests all domain information using the current request class and type (resource record). You can specify a server other than the current server to perform domain name resolution.
- In interactive session mode, an initial request is made to the selected name server to verify that the server is reachable. All subsequent interactive requests are sent to this server unless you specify a different server using the set server or set lserver subcommands .
- You can query by entering the domain name of the node or subnet for which information is required and set the data type of the information to be retrieved using the set querytype subcommand . You can only define one resource record type for a domain name in a single query, unless the generic query type of any has been defined.
- Requests processed by NSLOOKUP that specify an address may produce unexpected results. If the current query type is address (A) or domain name pointer (PTR), NSLOOKUP generates a query of type PTR for the address specified in the in-addr.arpao domain. IP6.arpaThis returns PTR records, which define the hostname for the specified address. If the current request type is not one of these two types, a request is made using the current request type, with the specified domain name as the supplied address.
- NSLOOKUP does not query a domain name if the name is unqualified and matches one of the defined options.
- A name server often requires a fully qualified domain name for queries. However, NSLOOKUP allows specification of a default subnet domain using the set domain subcommand , with the initial default obtained from the TCPIP DATA file. When defname is enabled, using the set defname subcommand , the default domain name specified by set domain is appended to all unqualified domain names. For example, if the default domain name is fourex.oz and definition is enabled, a request for the name toolah automatically generates a request packet containing the domain name toolah.fourex.oz.
- The domain name or address of a query can be followed by the domain name or Internet address of a name server to contact for the query. If not specified, the current name server is used. For example, toolah wurrup.fourex.oz queries the wurrup.fourex.oz nameserver for information about the toolah node.
- When dotted domain names are specified, the trailing dot (indicating a fully qualified domain name) is optional. NSLOOKUP removes the trailing period if present. If you specify a root domain, the domain name must have a colon at the end. For example, specify mynode..when the node mynode is in the root domain.
When specifying set NSLOOKUP subcommands in command-line mode, do not use set before the subcommand. For example, to specify a name server (NS) record search for the domain name fourex.oz, type the following on the command line:
nslookup -querytype=ns fourex.oz Copied! The -querytype=ns option is a set subcommand , but set is omitted from the command. For more information on using the set subcommands , see NSLOOKUP set Subcommands.