You can use DIG in command mode, where all options are specified on the invoking command line, or in batch mode, where a group of queries are placed in a data set and executed by a single invocation of DIG. DIG provides a large number of options for controlling queries and screen output, including most of the functions of NSLOOKUP.
You can create a data set for batch mode queries using the -f data_set option. The data set contains complete queries, one per line, that are executed in a single invocation of DIG. The keyword DIG is not used when specifying queries in a batch data set. Blank lines are ignored, and lines beginning with a # symbol or a semicolon (;) in the first column are comment lines.
Options specified on the initial command line are in effect for all queries in the batch data set unless explicitly overridden. Several options are provided exclusively for use within batch data sets, giving greater control over DIG operation.
Some internal state information is retrieved from the TCPIP.DATA data set. See the z/OS Communications Server: IP Configuration Guide for more information about the TCPIP.DATA data set.
>>-DIG--+---------+--+-------------+--+-------+--+--------+-----> '-@server-' '-domain_name-' '-qtype-' '-qclass-' .-----------------------. V | >--+------------+----+-------------------+-+--------------------> '-%--comment-' '-| +queryoption |-' .---------------------. V | >----+-----------------+-+------------------------------------->< '-| -digoption |-' +queryoption |--+----------------------------+-------------------------------| | .-noaaonly-. | +-+-aaonly---+---------------+ | .-addit---. | +-+-noaddit-+----------------+ | .-answer---. | +-+-noanswer-+---------------+ | .-author---. | +-+-noauthor-+---------------+ | .-nocl-. | +-+-cl---+-------------------+ | .-cmd---. | +-+-nocmd-+------------------+ | .-nod2-. | +-+-d2---+-------------------+ | .-debug---. | +-+-nodebug-+----------------+ | .-defname---. | +-+-nodefname-+--------------+ +-domain--=--name------------+ | .-Header---. | +-+-noHeader-+---------------+ | .-header---. | +-+-noheader-+---------------+ | .-noignore-. | +-+-ignore---+---------------+ | .-noko-. | +-+-ko---+-------------------+ +-pfand--=--number-----------+ +-pfdef----------------------+ +-pfmin----------------------+ +-pfor--=--number------------+ +-pfset--=--number-----------+ | .-noprimary-. | +-+-primary---+--------------+ | .-noqr-. | +-+-qr---+-------------------+ | .-ques---. | +-+-noques-+-----------------+ | .-recurse---. | +-+-norecurse-+--------------+ | .-reply---. | +-+-noreply-+----------------+ +-retry--=--limit------------+ | .-nosort-. | +-+-sort---+-----------------+ | .-stats---. | +-+-nostats-+----------------+ +-timeout--=--time_out_value-+ | .-ttlid---. | +-+-nottlid-+----------------+ | .-novc-. | '-+-vc---+-------------------' -digoption |--+---------------------------------------+--------------------| +-c-- --query_class---------------------+ +-envsav--------------------------------+ +-envset--------------------------------+ +-f-- --data_set------------------------+ +-P-------------------------------------+ | .-53---------. | +-+-p-- --port-+------------------------+ | .-nostick-. | +-+-stick---+---------------------------+ | .-0-------------. | +-+-T-- --seconds-+---------------------+ +-t-- --query_type----------------------+ '-x-- --dotted_decimal_notation_address-'
If a domain name is specified, DIG uses the resolver library routines provided in the TCP⁄IP for MVS™ programming interface to map the name to an IP address.
If the qtype option is omitted, the default query type is A (an address query).
For example, using a dotted decimal notation IP address rather than a domain name removes any overhead associated with address mapping; however, this makes the command less readable. Therefore, in a batch data set you can include the domain name as a comment for readability.
parameter[=value]
and are a superset of the SET subcommand options for NSLOOKUP.Setting limit to 0 disables DIG from contacting the name server. The result is an error message no response from server.
The retry procedure for DIG uses both the limit value and the timeout period. Each time a request is resent, the timeout period for the request is twice the timeout period used for the last attempt.
# A comment
; more comments
wurrup any in +noH =noqu -c IN
toolah +pfmin
PING server_name ( Length 56 Count 3
For example, the domain name corresponding to IP address 101.3.100.2 is found by a query for the domain name 2.100.3.101.in-addr.arpa. You can use DIG -x 101.3.100.2 rather than reversing the address and appending in-addr.arpa.
System:
Ready
User:
DIG wurrup +noqu +noH +nohe +nocmd +noad +noau +nost +nocl
+nottl -envsav
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 0
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
The following queries show which part of the response output is controlled by each of the output control options. Each example enables or disables query options for tailoring output.
System: Ready
User:
DIG fourex.oz ns in +ad
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 3
;; ANSWERS:
fourex.oz NS wurrup.fourex.oz
fourex.oz NS canetoad.fourex.oz
;; ADDITIONAL RECORDS:
wurrup.fourex.oz A 101.3.100.12
wurrup.fourex.oz A 101.3.104.12
canetoad.fourex.oz A 101.3.104.40
System: Ready
User:
DIG fourex.oz ns in +addit +noanswer
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 3
;; ADDITIONAL RECORDS:
wurrup.fourex.oz A 101.3.100.12
wurrup.fourex.oz A 101.3.104.12
canetoad.fourex.oz A 101.3.104.40
System: Ready
User:
DIG noname +author
System: ;; ->>HEADER<<- opcode: QUERY , status: NXDOMAIN, id: 3
; Ques: 1, Ans: 0, Auth: 1, Addit: 0
;; AUTHORITY RECORDS:
fourex.oz SOA wurrup.fourex.oz adb.wurrup.fourex.oz (
10003 ;serial
3600 ;refresh
300 ;retry
3600000 ;expire
86400 ) ;minim
In the previous
example, the nonexistent domain name is noname. System: Ready
User:
DIG wurrup
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 0
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
System: Ready
User:
DIG wurrup +cl
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 0
;; ANSWERS:
wurrup.FOUREX.OZ. IN A 101.3.104.12
wurrup.FOUREX.OZ. IN A 101.3.100.12
System: Ready
User:
DIG wurrup +cmd
System: ; <<>> DIG 2.0 <<>> wurrup +cmd
; Ques: 1, Ans: 2, Auth: 0, Addit: 0
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
System: Ready
User:
DIG wurrup +qu
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 0
;; QUESTIONS:
;; wurrup.FOUREX.OZ, type = A, class = IN
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
System: Ready
User:
DIG wurrup +H
System: ;;>>HEADER<<- opcde: QUERY , status: NOERROR, id: 3
; Ques: 1, Ans: 2, Auth: 0, Addit: 0
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
System: Ready
User:
DIG wurrup +he
System: ;; flags: qr aa rd ra ; Ques: 1, Ans: 2, Auth: 0, Addit:
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
System: Ready
User:
DIG wurrup +qu +qr
System: ; Ques: 1, Ans: 0, Auth: 0, Addit: 0
;; QUESTIONS:
;; wurrup.FOUREX.OZ, type = A, class = IN
; Ques: 1, Ans: 2, Auth: 0, Addit: 0
;; QUESTIONS:
;; wurrup.FOUREX.OZ, type = A, class = IN
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
System: Ready
User:
DIG fourex.oz ns in +stats
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 3
;; ANSWERS:
fourex.oz NS wurrup.fourex.oz
fourex.oz NS canetoad.fourex.oz
;; FROM: FOUREXVM1 to SERVER: default -- 101.3.104.40
;; WHEN: Tue Mar 16 11:06:40 1992
;; MSG SIZE sent: 24 rcvd: 116
System: Ready
User:
DIG fourex.oz ns in +ttlid
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 3
;; ANSWERS:
fourex.oz 9999999 NS wurrup.fourex.oz
fourex.oz 9999999 NS canetoad.fourex.oz
System: Ready
User:
DIG wurrup +d2
System: ;; res_mkquery(0, wurrup, 1, 1)
;; Querying server (# 1) address = 101.3.104.40
;; id = 3 - sending now: 4044656426 msec
; Ques: 1, Ans: 2, Auth: 0, Addit: 0
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
The following examples show how options control the use and value of the default domain.
System: Ready
User:
DIG wurrup +nodefname +qu
System: ;;>>HEADER<<- opcde: QUERY , status: SERVFAIL, id: 3
; Ques: 1, Ans: 0, Auth: 0, Addit: 0
;; QUESTIONS:
;; wurrup, type = A, class = IN
System: Ready
User:
DIG wurrup +do=fourexpd +qu
System: ;; ->>HEADER<<- opcode: QUERY , status: SERVFAIL, id: 3
; Ques: 1, Ans: 0, Auth: 0, Addit: 0
;; QUESTIONS:
;; wurrup.fourexpd, type = A, class = IN
System: Ready
User:
DIG fourex.oz ns in +sort
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 3
;; ANSWERS:
fourex.oz NS canetoad.fourex.oz
fourex.oz NS wurrup.fourex.oz
System: Ready
User:
DIG -x 101.3.100.20 +qu
System: ; Ques: 1, Ans: 1, Auth: 0, Addit: 0
;; QUESTIONS:
;; 20.100.3.101.in-addr.arpa, type = ANY, class = IN
;; ANSWERS:
20.100.3.101.in-addr.arpa. PTR galah.
System: Ready
User:
DIG wurrup -c any +qu
System: ; Ques: 1, Ans: 2, Auth: 0, Addit: 0
;; QUESTIONS:
;; wurrup.FOUREX.OZ, type = A, class = ANY
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
System: Ready
User:
DIG wurrup -t any +qu
System: ; Ques: 1, Ans: 3, Auth: 0, Addit: 0
;; QUESTIONS:
;; wurrup.FOUREX.OZ, type = ANY, class = IN
;; ANSWERS:
wurrup.FOUREX.OZ. A 101.3.104.12
wurrup.FOUREX.OZ. A 101.3.100.12
wurrup.FOUREX.OZ. HINFO RS6000 AIX3.1
The following lists the batch data set, test.digbat, used for this example. The default environment has been removed by discarding the user_id.DIG.ENV data set. The DIG command is omitted for all entries in the data set.
Note the effect of the -envset and -stick options on the output:
wurrup any in +noH +nohe +noqu +noad +noau -envset -stick
wurrup any in
toolah a in +d2
toolah a in
toolah a in +d2 -nostick
toolah a in
toolah a in +nod2
toolah a in
System: Ready
User:
DIG -f test.digbat
System: ; <<>> DIG 2.0 <<>> DIG wurrup any in +noH +nohe +noqu +noad
+noau -envset -stick
; Ques: 1, Ans: 3, Auth: 0, Addit: 0
;; ANSWERS:
wurrup.FOUREX.OZ. 9999999 A 101.3.104.12
wurrup.FOUREX.OZ. 9999999 A 101.3.100.12
wurrup.FOUREX.OZ. 86400 HINFO RS6000 AIX3.1
;; FROM: FOUREXVM1 to SERVER: default -- 101.3.104.40
;; WHEN: Tue Mar 16 11:15:57 1992
;; MSG SIZE sent: 31 rcvd: 95
System: ; <<>> DIG 2.0 <<>> DIG wurrup any in
; Ques: 1, Ans: 3, Auth: 0, Addit: 0
;; ANSWERS:
wurrup.FOUREX.OZ. 9999999 A 101.3.104.12
wurrup.FOUREX.OZ. 9999999 A 101.3.100.12
wurrup.FOUREX.OZ. 86400 HINFO RS6000 AIX3.1
;; FROM: FOUREXVM1 to SERVER: default -- 101.3.104.40
;; WHEN: Tue Mar 16 11:15:57 1992
;; MSG SIZE sent: 31 rcvd: 95
System: ; <<>> DIG 2.0 <<>> DIG toolah a in +d2
;; res_mkquery(0, toolah, 1, 1)
;; Querying server (# 1) address = 101.3.104.40
;; id = 3 - sending now: 4046124888 msec
; Ques: 1, Ans: 1, Auth: 0, Addit: 0
;; ANSWERS:
toolah.FOUREX.OZ. 9999999 A 101.3.100.2
;; FROM: FOUREXVM1 to SERVER: default -- 101.3.104.40
;; WHEN: Tue Mar 16 11:15:57 1992
;; MSG SIZE sent: 31 rcvd: 47
System: ; <<>> DIG 2.0 <<>> DIG toolah a in
; Ques: 1, Ans: 1, Auth: 0, Addit: 0
;; ANSWERS:
toolah.FOUREX.OZ. 9999999 A 101.3.100.2
;; FROM: FOUREXVM1 to SERVER: default -- 101.3.104.40
;; WHEN: Tue Mar 16 11:15:57 1992
;; MSG SIZE sent: 31 rcvd: 47
System: ; <<>> DIG 2.0 <<>> DIG toolah a in +d2 -nostick
;; res_mkquery(0, toolah, 1, 1)
;; Querying server (# 1) address = 101.3.104.40
;; id = 3 - sending now: 4046125037 msec
; Ques: 1, Ans: 1, Auth: 0, Addit: 0
;; ANSWERS:
toolah.FOUREX.OZ. 9999999 A 101.3.100.2
;; FROM: FOUREXVM1 to SERVER: default -- 101.3.104.40
;; WHEN: Tue Mar 16 11:15:57 1992
;; MSG SIZE sent: 31 rcvd: 47
System: ; <<>> DIG 2.0 <<>> DIG toolah a in
;; res_mkquery(0, toolah, 1, 1)
;; Querying server (# 1) address = 101.3.104.40
;; id = 5 - sending now: 4046125101 msec
; Ques: 1, Ans: 1, Auth: 0, Addit: 0
;; ANSWERS:
toolah.FOUREX.OZ. 9999999 A 101.3.100.2
;; FROM: FOUREXVM1 to SERVER: default -- 101.3.104.40
;; WHEN: Tue Mar 16 11:15:57 1992
;; MSG SIZE sent: 31 rcvd: 47
System: ; <<>> DIG 2.0 <<>> DIG toolah a in +nod2
; Ques: 1, Ans: 1, Auth: 0, Addit: 0
;; ANSWERS:
toolah.FOUREX.OZ. 9999999 A 101.3.100.2
;; FROM: FOUREXVM1 to SERVER: default -- 101.3.104.40
;; WHEN: Tue Mar 16 11:15:57 1992
;; MSG SIZE sent: 31 rcvd: 47
System: ; <<>> DIG 2.0 <<>> DIG toolah a in
; Ques: 1, Ans: 1, Auth: 0, Addit: 0
;; ANSWERS:
toolah.FOUREX.OZ. 9999999 A 101.3.100.2
;; FROM: FOUREXVM1 to SERVER: default -- 101.3.104.40
;; WHEN: Tue Mar 16 11:15:58 1992
;; MSG SIZE sent: 31 rcvd: 47
The queryoption and digoption parameters are case sensitive and must be entered in lowercase. Domain names, query types, query classes, and the values associated with queryoption and digoption parameters are not case sensitive.