This material contains examples of NSLOOKUP command-mode queries, and interactive-mode queries using the various options available for NSLOOKUP commands.
The following examples show how to use NSLOOKUP to extract information from a name server. The queries are executed from the z/OS® host uluru on the network described in Figure 1.
User: nslookup toolah.fourex.oz wurrup.fourex.oz
System: Server: wurrup
Address: 101.3.104.12
Name: toolah.fourex.oz
Address: 101.3.100.2
User: nslookup -querytype=ns fourex.oz
System: Server: canetoad
Address: 101.3.104.40
fourex.oz nameserver = wurrup.fourex.oz
fourex.oz nameserver = canetoad.fourex.oz
wurrup.fourex.oz internet address = 101.3.100.12
wurrup.fourex.oz internet address = 101.3.104.12
canetoad.fourex.oz internet address = 101.3.104.40
User: nslookup -do=fourex.oz uluru
System: Server: canetoad.fourex.oz
Address: 101.3.104.40
Name: uluru.fourex.oz
Address: 101.3.104.38
User: nslookup -srchlist=nowhere.oz/fourex.oz uluru
System: Server: canetoad.fourex.oz
Address: 101.3.104.40
Name: uluru.fourex.oz
Address: 101.3.104.38
User:
nslookup - wurrup
System: Default Server: wurrup
Address: 101.3.104.12
All following examples are in the
interactive mode initiated in the preceding example. User:
set all
Default Server: wurrup.fourex.oz
Address: 101.3.104.12
Set options:
nodebug defname nosearch recurse
nod2 novc noignoretc port=53
querytype=A class=IN timeout=60 retry=1
root=ns.nic.ddn.mil.
domain=FOUREX.OZ
srchlist=FOUREX.OZ
User:
toolah
System: Server: wurrup
Address: 101.3.104.12
Name: toolah.FOUREX.OZ
Address: 101.3.100.2
User:
set q=HINFO
toolah
System: Server: wurrup
Address: 101.3.104.12
toolah.FOUREX.OZ CPU = RS6000 OS = AIX3.1
User:
set q=NS
fourex.oz
System: Server: wurrup
Address: 101.3.104.12
fourex.oz nameserver = wurrup.fourex.oz
fourex.oz nameserver = canetoad.fourex.oz
wurrup.fourex.oz internet address = 101.3.100.12
wurrup.fourex.oz internet address = 101.3.104.12
canetoad.fourex.oz internet address = 101.3.104.40
User: server canetoad
System: Default Server: canetoad.FOUREX.OZ
Address: 101.3.104.40
User:
set q=A
gecko
System: Server: canetoad.FOUREX.OZ
Address: 101.3.104.40
Name: gecko.FOUREX.OZ
Address: 101.3.100.90
User:
set deb
wurrup
System: Server: canetoad.FOUREX.OZ
Address: 101.3.104.40
res_mkquery(0, wurrup.FOUREX.OZ, 1, 1)
------------
Got answer:
HEADER:
opcode = QUERY, id = 7, rcode = NOERROR
header flags: response, auth. answer, want recursion,
recursion avail
questions = 1, answers = 2, authority records = 0,
additional = 0
QUESTIONS:
wurrup.FOUREX.OZ, type = A, class = IN
ANSWERS:
-> wurrup.FOUREX.OZ
internet address = 101.3.104.12
ttl = 9999999 (115 days 17 hours 46 mins 39 secs)
-> wurrup.FOUREX.OZ
internet address = 101.3.100.12
ttl = 9999999 (115 days 17 hours 46 mins 39 secs)
------------
Name: wurrup.FOUREX.OZ
Addresses: 101.3.104.12, 101.3.100.12
User:
set nodeb
User:
ls fourex.oz
System: [canetoad.FOUREX.OZ]
fourex.oz server = wurrup.fourex.oz
wurrup 101.3.100.12
wurrup 101.3.104.12
fourex.oz server = canetoad.fourex.oz
canetoad 101.3.104.40
gecko 101.3.100.90
wurrup 101.3.100.12
wurrup 101.3.104.12
galah 101.3.100.20
bandicoot 101.3.104.52
toolah 101.3.100.2
canetoad 101.3.104.40
loopback 127.0.0.1
uluru 101.3.104.38
User:
ls -a fourex.oz
System: [canetoad.FOUREX.OZ]
localhost loopback.fourex.oz
infoserver wurrup.fourex.oz
pabxserver wurrup.fourex.oz
User:
exit
User:
help
System:
Commands: (identifiers are shown in uppercase, <> means optional)
NAME - print info about the host/domain NAME using default server
NAME1 NAME2 - as above, but use NAME2 as server
help or ? - print info on common commands; see nslookup man for details
set OPTION - set an option
all - print options, current server and host
<no>debug - print debugging information
<no>d2 - print exhaustive debugging information
<no>defname - append domain name to each query
<no>recurse - ask for recursive answer to query
<no>vc - always use a virtual circuit
domain=NAME - set default domain name to NAME
srchlist=N1</N2/.../N6> - set domain to N1 and search list to N1,N2, etc.
root=NAME - set root server to NAME
retry=X - set number of retries to X
timeout=X - set initial time-out interval to X seconds
querytype=X - set query type, e.g., A,ANY,CNAME,HINFO,MX,NS,PTR,SOA,WKS
type=X - synonym for querytype
class=X - set query class to one of IN (Internet), CHAOS, HESIOD or ANY
server NAME - set default server to NAME, using current default server
lserver NAME - set default server to NAME, using initial server
finger <USER> - finger the optional NAME at the current default host
root - set current default server to the root
ls <opt> DOMAIN ^> DATASET| - list addresses in DOMAIN
(optional: output to DATASET)
-a - list canonical names and aliases
-h - list HINFO (CPU type and operating system)
-s - list well-known services
-d - list all records
-t TYPE - list records of the given type (e.g., A,CNAME,MX, etc.)
view DATASET - sort an 'ls' output file and view it with more
exit - exit the program
User:
finger
System:
[canetoad.FOUREX.OZ]
Further output to be generated ....
set domain=fourex.oz
This command overrides the DOMAINORIGIN statement in the tcpip.TCPIP.DATA data set.