| 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:
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.
Allows you to direct the query to a DNS server other than the current DNS server for the query session.
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.
The class specifies the protocol group of the information. The initial default query class is IN.
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.
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.
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.
Restrictions:
| Top |
| Keyword | Description | Choices | Notes |
|---|---|---|---|
| HOSTNAME | Query name | Character value, *NONE | Optional, Positional 1 |
| DMNNAMSVR | Domain name server | Character value, *CFG | Optional, Positional 2 |
| Top |
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.
Note: This value is only valid if the STRDNSQRY command is run in an interactive job.
| Top |
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:
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.
| Top |
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 |
*ESCAPE Messages
| Top |