Start NSLOOKUP Query (NSLOOKUP)
Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Start NSLOOKUP Query (STRDNSQRY) command, or its alias NSLOOKUP, starts the Name Server Lookup tool. This tool is deprecated and is only provided for backwards compatibility. The recommended tool is now DIG which can be run using the Start DIG Query (STRDIGQRY or DIG) command. In addition, another simpler tool, HOST, is also recommended which can be run using the Start HOST Query (STRHOSTQRY or HOST) command.
NSLOOKUP is an interactive query tool that allows you to retrieve information from or test the response of a Domain Name System (DNS) server. You can verify that a DNS server is responding correctly before you configure your system to use it. You can also retrieve DNS information about hosts, domains, and other DNS servers.
NSLOOKUP asks for (queries) information from DNS servers. To begin a NSLOOKUP query session, an active DNS server must be designated the 'current' server for the query session. The current server is the DNS server that NSLOOKUP sends all queries to unless you tell it otherwise. All references in the following help to 'the current server', or 'the current DNS server', refer only to the current DNS server for the current NSLOOKUP query session.
NSLOOKUP retrieves information from DNS servers. It needs an active DNS server to which it can send its queries. If you do not specify a DNS server with DMNNAMSVR when you start the tool, it will attempt to set one of the following as its current DNS server for the session:
- The DNS server your system is configured to use
- The DNS server that is running on your local system.
If neither of these conditions exist, NSLOOKUP will not be able to retrieve any information until you specify a DNS server to query. DMNNAMSVR allows you to start the query session and set the DNS server of your choice as the default server for the session.
Following is a list of NSLOOKUP subcommands that can be used once the query session is started.
- host
- Look up information for host and query the current DNS server.
- host dns-server
- Look up information for host, but query dns-server instead of the current DNS server.
Allows you to direct the query to a DNS server other than the current DNS server for the query session.
- server dns-server
- Change the current DNS server to dns-server, using the current DNS server to get the IP address of dns-server.
- lserver dns-server
- Change the current DNS server to dns-server, using the initial DNS server to get the IP address of dns-server.
Useful if you switched default DNS servers during your query session, and the current DNS server cannot resolve the new DNS server name. lserver allows you to make the switch using your initial DNS server instead of the current one. If the initial DNS server also cannot resolve the new DNS name, substitute the IP address for the name, if you know it. If you do not know the IP address for the new DNS server, try restarting the NSLOOKUP session using the DMNNAMSVR parameter to specify the new DNS server as the current server for the query session.
- root
- This interactive command is not implemented.
- finger
- This interactive command is not implemented.
- ls
- This interactive command is not implemented.
- view
- This interactive command is not implemented.
- help
- This interactive command is not implemented.
- ?
- This interactive command is not implemented.
- exit
- Exits interactive mode.
- set keyword
- set keyword=value
- This command is used to change state information that affects the lookups.
- set all
- Displays the current values of the frequently used options to set. Information about the current DNS server and host is also displayed.
- set class=value
- Change the default query class to one of the following values:
- IN (the Internet class)
- CH (the CHAOS class)
- HS (the Hesiod class)
- ANY (wildcard - any class)
The class specifies the protocol group of the information. The initial default query class is IN.
- set debug
- Turn debugging mode on. A lot more information is displayed about the packet sent to the current DNS server and the resulting answer.
- set nodebug
- Turn debugging mode off.
- set d2
- Turn exhaustive (verbose) debugging mode on. A lot more information is displayed about the packet sent to the current DNS server and the resulting answer.
- set nod2
- Turn exhaustive (verbose) debugging mode off.
- set domain=name
- Set default domain to name.
- set search
- Append the name in the domain search list to the request.
- set nosearch
- Do not append the name in the domain search list to the request.
- set port=X
- Use port 'X' to query the current DNS server, where 'X' is a numerical port number. The default value is 53.
Note: The well-known port number for DNS servers is 53 and most DNS servers use it. You do not normally need to set the port value unless the DNS server you want to query is not using port 53. Other ports are sometimes used under special circumstances.
- set querytype=X
- set type=X
- Sets the record type that used in the query. Replace 'X' with one of the DNS record types (A, CNAME, MX, PTR, AAAA, etc.).
- set recurse
- Tell the current DNS server to query other DNS servers if the current server does not have the information.
- set norecurse
- Tell the current DNS server to not query other DNS servers if the current server does not have the information.
- set retry=X
- Set the number of retries to X (where X is a numerical value). The default value for number of retries is 1.
Note: The retry value works together with the timeout value, which is the time in seconds that NSLOOKUP waits before making the first retry. Retry values are usually set to 1 or 2.
- set timeout=X
- Set the timeout interval to X seconds (where X is a numerical value). The default value is 5 seconds.
Note: Timeout determines how long NSLOOKUP waits before making the first retry if no reply is received on the first query. The timeout value doubles after each unsuccessful retry.
- set vc
- Use TCP for queries instead of UDP.
- set novc
- Use UDP for queries instead of TCP.
Restrictions:
- This command is not threadsafe when run in interactive mode.
Top |
Parameters
Keyword | Description | Choices | Notes |
---|---|---|---|
HOSTNAME | Query name | Character value, *NONE | Optional, Positional 1 |
DMNNAMSVR | Domain name server | Character value, *CFG | Optional, Positional 2 |
Top |
Query name (HOSTNAME)
Specifies the name that you want the Domain Name System (DNS) server to supply information about. You can use either a name or a numerical IP address. For example, a name could be "mycomputer.mycompany.com" or "mycompany.com". A numerical IP address could be "64.236.1.107". Use either the name to obtain the address, or use the address to obtain the name.
- *NONE
- No host name is provided. If *NONE is specified or passed as the default for this parameter, an interactive NSLOOKUP session will be started.
Note: This value is only valid if the STRDNSQRY command is run in an interactive job.
- host-name
- Specify the name to use for the DNS server query.
- host-internet-address
- Specify the IPv4 address in dotted-decimal notation or a colon-delimited IPv6 address of a host to use for the DNS server query.
Top |
Domain name server (DMNNAMSVR)
Specifies the name or the IP address of the DNS server that NSLOOKUP will use as its current server for the query session. You can specify any DNS server to which your TCP/IP network has access. Or, if you want to test the response of a DNS server prior to designating it for use by your system, specify that server.
NSLOOKUP retrieves information from DNS servers. It needs an active DNS server to send its queries to. If you do not specify a DNS server with DMNNAMSVR when you start the tool, it will attempt to set one of the following as its current DNS server for the session:
- DNS server your system is configured to use (*CFG), or
- The DNS server that is running on your local system.
If neither of these conditions exist, NSLOOKUP will not be able to retrieve any information until you specify a DNS server to query. DMNNAMSVR allows you to start the query session and set the DNS server of your choice as the current server for the session.
- *CFG
- Use the DNS server that is currently designated for use by this system. These server internet addresses can be seen by prompting the Change TCP/IP Domain (CHGTCPDMN) command and looking at the values shown for the INTNETADR parameter.
- server-domain-name
- Specify the name of a DNS server.
- server-internet-address
- Specify the IP address of a DNS server.
Top |
Examples
Example 1: Simple DNS Lookup
STRDNSQRY HOSTNAME('64.236.1.107') DMNNAMSVR(*CFG)
This command starts a DNS query using the host located at IP address 64.236.1.107 and the DNS server that is currently designated for use by this system.
The output from this type of query might look like this:
Server: 10.0.1.100 Address: 10.0.1.100#53 Non-authoritative answer: 107.1.236.64.in-addr.arpa name = any-ext.ns.aol.com. Authoritative answers can be found from: 1.236.64.in-addr.arpa nameserver = dns-02.atdn.net. 1.236.64.in-addr.arpa nameserver = dns-01.atdn.net. dns-02.atdn.net internet address = 205.188.157.236 dns-01.atdn.net internet address = 152.163.159.236
Example 2: DNS Lookup of an Internet Address
NSLOOKUP HOSTNAME(aol.com) DMNNAMSVR('64.236.1.107')
This command starts a DNS query to the local machine to find the the internet address for aol.com.
The output from this type of query might look like this:
Server: 64.236.1.107 Address: 64.236.1.107#53 aol.com origin = dns-01.ns.aol.com mail addr = hostmaster.aol.net serial = 2006080400 refresh = 1800 retry = 300 expire = 604800 minimum = 600
Top |
Error messages
*ESCAPE Messages
- DNS0013
- Error processing command parameters.
- DNS0065
- Option 33 of i5/OS is required, but is not installed.
- TCP7124
- Program &1 in library &2 type *PGM ended abnormally.
Top |