Skip to content
Snippets Groups Projects
kdig.1.in 4.93 KiB
Newer Older
.TH "kdig" "1" "April 2013" "CZ.NIC Labs" "Knot DNS, version @VERSION@"
\- Advanced DNS lookup utility (libknot equivalent of ISC dig)
[\fIcommon-settings\fR] [\fIquery\fR [\fIsettings\fR]]...
This utility sends one or more DNS \fIqueries\fR to a nameserver. Each query can
have individual \fIsettings\fR, or it can be specified globally via \fIcommon-settings\fR,
which must precede \fIquery\fR specification.
\fIquery
\fIname\fR | \fB-q\fR \fIname\fR | \fB-x\fR \fIaddress\fR
.TP
\fIcommon-settings, settings
[\fIclass\fR] [\fItype\fR] [\fB@\fIserver\fR]... [\fIoptions\fR]
.TP
\fIname\fR
Is a domain name that is to be looked up.
.TP
\fIserver\fR
Is a name or an address of the nameserver to send a query to. The address
can be specified using [address]:port notation. If no server is specified
the servers from \fB/etc/resolv.conf\fR are used.
.TP
If no arguments are provided, \fBkdig\fR sends \fINS\fR query for root zone.
.SH OPTIONS
.TP 4
.BI -4
Use IPv4 protocol only.
.TP
.BI -6
Use IPv6 protocol only.
.TP
.BI -b \ address
Set the source IP address of the query to \fIaddress\fR. The address
can be specified using [address]:port notation.
.TP
.BI -c \ class
Set query class (e.g. \fICH\fR, \fICLASS4\fR).
An explicit variant of \fIclass\fR specification.
The default class is \fIIN\fR.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
.BI -d
Enable debug messages if any.
.TP
\fB\-h\fR, \fB\-\-help\fR
Print short help.
.TP
.BI -k \ keyfile
Use TSIG or SIG\-0 key stored in a file \fIkeyfile\fR to authenticate the request.
Supported file format is the same as generated by ISC \fBdnssec\-keygen\fR.
The key comprises of public (.key extension) and private part (.private extension).
Either of these file names or a name without the extension can be specified as \fIkeyfile\fR
parameter.
.TP
.BI -p \ port
Set nameserver port number or service name to send a query to.
The default port is \fI53\fR.
.TP
.BI -q \ name
Set query name. An explicit variant of \fIname\fR specification.
.TP
.BI -t \ type
Set query type (e.g. \fINS\fR, \fIIXFR=12345\fR, \fITYPE65535\fR).
An explicit variant of \fItype\fR specification. The default type is \fIA\fR.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB\-v\fR, \fB\-\-version\fR
Print program version.
.TP
.BI -x \ address
Send \fIPTR\fR query for IPv4 or IPv6 \fIaddress\fR.
.TP
.BI -y \ \fR[\fIalgo:\fR]\fIkeyname:key\fR
Use TSIG key with a name \fIkeyname\fR to authenticate the request. The \fIalgo\fR
part specifies the algorithm (the default is hmac\-md5) and \fIkey\fR specifies
the shared secret encoded in Base64.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBmultiline\fR
Wrap long records to more lines.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBshort\fR
Show record data only.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBaaflag\fR
Set AA flag.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBtcflag\fR
Set TC flag.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBrdflag\fR
Set RD flag.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBrecurse\fR
Same as +\fR[\fBno\fR]\fBrdflag\fR
\fB+\fR[\fBno\fR]\fBrec\fR
Same as +\fR[\fBno\fR]\fBrdflag\fR
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBraflag\fR
Set RA flag.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBzflag\fR
Set zero flag bit.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBadflag\fR
Set AD flag.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBcdflag\fR
Set CD flag.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBdnssec\fR
Set DO flag.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBall\fR
Show all packet sections.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBqr\fR
Show query packet.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBheader\fR
Show packet header.
.TP
\fB+\fR[\fBno\fR]\fBedns\fR
Show EDNS pseudosectio.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBquestion\fR
Show question section.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBanswer\fR
Show answer section.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBauthority\fR
Show authority section.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBadditional\fR
Show additional section.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBstats\fR
Show trailing packet statistics.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBcl\fR
Show DNS class.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBttl\fR
Show TTL value.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+time=\fIT\fR
Set wait for reply interval in seconds (default is 5 seconds).
Daniel Salzman's avatar
Daniel Salzman committed
\fB+retries=\fIN\fR
Set number of retries (default is 2). This doesn't apply to AXFR or IXFR.
Daniel Salzman's avatar
Daniel Salzman committed
\fB+bufsize=\fIB\fR
Set EDNS buffer size in bytes (default is 512 bytes).
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBtcp\fR
Use TCP protocol.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBfail\fR
Stop if SERVFAIL.
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBignore\fR
Don't use TCP automatically if truncated reply is received.
.TP
Daniel Salzman's avatar
Daniel Salzman committed
\fB+\fR[\fBno\fR]\fBnsid\fR
Request nameserver identifier (NSID).
.SH NOTE
Options \fB-k\fR and \fB-y\fR cannot be used mutually.
.SH EXAMPLES
.B Example 1. Get A record for example.com:
.TP
# kdig example.com A
.TP
.B Example 2. Perform AXFR for zone example.com from the server 192.0.2.1:
.TP
# kdig example.com -t AXFR @192.0.2.1
.TP 12
.B Example 3. Send one A query for example.com from 192.0.2.1 and one reverse \
lookup for address 2001:DB8::1 from 192.0.2.2. Both using TCP protocol:
.TP
# kdig +tcp example.com -t A @192.0.2.1 -x 2001:DB8::1 @192.0.2.2
.SH FILES
.BI /etc/resolv.conf
.SH AUTHOR
Daniel Salzman (\fBhttp://knot-dns.cz\fR)
.TP
Please send any bugs or comments to \fBknot-dns@labs.nic.cz\fR
.SH SEE ALSO
.BI khost\fR(8),
.BI knsupdate\fR(8).