Where allowed to run: Interactive environments (*INTERACT *IPGM *IREXX *EXEC) Threadsafe: No |
Parameters Examples Error messages |
Start DNS Query (STRDNSQRY), and its alias NSLOOKUP, start the NSLookup (Name Server Lookup) tool.
NSLookup is an interactive query tool that allows you to retrieve information from, or test the response of a 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 DNS servers.
Note: NSLookup asks for (queries) information from DNS servers. To begin a NSLookup query session, an active DNS server must be designated the 'default' server for the query session. The default server is the DNS server that NSLookup sends all queries to unless you tell it otherwise. All references in the following help to 'the default server', or 'the default DNS server', refer only to the default DNS server for the current NSLookup query session.
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 DMNAMSVR when you start the tool, it will attempt to set one of the following as its default DNS server for the session: 1. The DNS server your system is configured to use, or 2. 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.
There are two parameters for this command:
These parameters are used with STRDNSQRY to specify a default DNS server for the query session or, to request information about a specific host on session start up. Help for these parameters follows the list of session subcommands.
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 or 'default' 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 default 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 default server for the query session.
Note: The default value for number of retries is 1. 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=X 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. The default value is 5 seconds.
Note: This type of information record is not usually available.
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. To query DNS server that is not using port 53, set the port value to the same port number the DNS server is using.
ls company.us.com > /temp/filename.extension
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
HOSTNAME | Host | Character value, *NONE | Optional, Positional 1 |
DMNNAMSVR | Domain Name Server | Character value, *CFG | Optional |
Top |
Specify the TCP/IP host that you want the Domain Name Service (DNS) server to supply information about. You can use either the host's worded name, or its numerical IP address. For example, a host's name is anybiz.usa.com, and its numerical address is 123.4.56.7. Use either the name to obtain the address, or the address to obtain the name.
Top |
Specify the name or the IP address of the DNS server that NSLookup will use as its default server for the query session.
Note: 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 DMNAMSVR when you start the tool, it will attempt to set one of the following as its default DNS server for the session: 1. The DNS server your system is configured to use, or 2. 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.
Use the DMNNAMSVR parameter of the STRDNSQRY command to specify a default DNS server for your NSLookup query session. You can specify any DNS server your TCP/IP network has access to. Or, if you want to test the response of a DNS server prior to designating it for use by your system, specify that server.
Top |
STRDNSQRY HOSTNAME('9.12.234.14') DMNNAMSVR(*CFG)
This command starts a DNS query using the host located at IP address 9.12.234.14 and the DNS server that is currently designated for use by this system.
Top |
None
Top |