xref: /openbsd-src/usr.bin/dig/dig.1 (revision 9835a5e128ac1db1a0a5e36c27d1a17b7926c0b3)
1*9835a5e1Sflorian.\" $OpenBSD: dig.1,v 1.8 2024/12/27 09:04:48 florian Exp $
25185a700Sflorian.\"
35185a700Sflorian.\" Copyright (C) 2000-2011, 2013-2018 Internet Systems Consortium, Inc. ("ISC")
45185a700Sflorian.\"
55185a700Sflorian.\" Permission to use, copy, modify, and/or distribute this software for any
65185a700Sflorian.\" purpose with or without fee is hereby granted, provided that the above
75185a700Sflorian.\" copyright notice and this permission notice appear in all copies.
85185a700Sflorian.\"
95185a700Sflorian.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
105185a700Sflorian.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
115185a700Sflorian.\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
125185a700Sflorian.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
135185a700Sflorian.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
145185a700Sflorian.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
155185a700Sflorian.\" PERFORMANCE OF THIS SOFTWARE.
165185a700Sflorian.\"
17*9835a5e1Sflorian.Dd $Mdocdate: December 27 2024 $
185185a700Sflorian.Dt DIG 1
195185a700Sflorian.Os
205185a700Sflorian.Sh NAME
215185a700Sflorian.Nm dig
225185a700Sflorian.Nd DNS lookup utility
235185a700Sflorian.Sh SYNOPSIS
245185a700Sflorian.Nm
255185a700Sflorian.Op Pf @ Ar server
265185a700Sflorian.Op Fl 46hiuv
2765e34726Sschwarze.Op Fl b Ar sourceaddr Ns Op Pf # Ar port
285185a700Sflorian.Op Fl c Ar class
295185a700Sflorian.Op Fl f Ar file
305185a700Sflorian.Op Fl k Ar keyfile
315185a700Sflorian.Op Fl p Ar port
325185a700Sflorian.Op Fl q Ar name
335185a700Sflorian.Op Fl t Ar type
345185a700Sflorian.Op Fl x Ar addr
355185a700Sflorian.Op Fl y Oo Ar hmac : Oc Ns Ar name : Ns Ar key
365185a700Sflorian.Op Ar name
375185a700Sflorian.Op Ar type
385185a700Sflorian.Op Ar class
395185a700Sflorian.Op Pf + Ar queryopt ...
405185a700Sflorian.Sh DESCRIPTION
415185a700SflorianThe
425185a700Sflorian.Nm
435185a700Sfloriancommand is a flexible tool for interrogating DNS name servers.
445185a700SflorianIt performs DNS lookups and displays the answers that are returned from the name
455185a700Sflorianservers that were queried.
465185a700SflorianAlthough
475185a700Sflorian.Nm
485185a700Sflorianis normally used with command line arguments, it also has a batch mode of
495185a700Sflorianoperation for reading lookup requests from a file.
505185a700SflorianWhen no command line arguments or options are given,
515185a700Sflorian.Nm
525185a700Sflorianwill perform an NS query for '.' (the root).
535185a700Sflorian.Pp
545185a700SflorianA typical invocation of
555185a700Sflorian.Nm
565185a700Sflorianlooks like:
575185a700Sflorian.Pp
585185a700Sflorian.Dl dig @server [options] name type [class] [+queryopt]
595185a700Sflorian.Bl -tag -width +queryopt
605185a700Sflorian.It Pf @ Ar server
615185a700SflorianThe name or IP address of the name server to query.
625185a700SflorianWhen the argument is a hostname,
635185a700Sflorian.Nm
645185a700Sflorianresolves that name before querying that name server.
655185a700SflorianIf no
665185a700Sflorian.Ar server
675185a700Sflorianargument is provided,
685185a700Sflorian.Nm
695185a700Sflorianwill try each of the servers listed in
705185a700Sflorian.Xr resolv.conf 5 .
715185a700SflorianIf no usable addresses are found,
725185a700Sflorian.Nm
735185a700Sflorianwill send the query to the local host.
745185a700SflorianThe reply from the name server that responds is displayed.
755185a700Sflorian.It Ar name
765185a700SflorianThe name of the resource record that is to be looked up.
775185a700Sflorian.It Ar type
785185a700SflorianThe type of query, as documented for
795185a700Sflorian.Fl t .
805185a700SflorianThe default is
815185a700Sflorian.Cm A .
825185a700Sflorian.It Ar class
835185a700SflorianThe query class, as documented for
845185a700Sflorian.Fl c .
855185a700SflorianThe default is
865185a700Sflorian.Cm IN .
875185a700Sflorian.It Pf + Ar queryopt
885185a700SflorianOne or more query options,
895185a700Sflorianas documented in
905185a700Sflorian.Sx QUERY OPTIONS ,
915185a700Sflorianbelow.
925185a700Sflorian.El
935185a700Sflorian.Pp
945185a700SflorianThe options are as follows:
955185a700Sflorian.Bl -tag -width Ds
965185a700Sflorian.It Fl 4
975185a700SflorianUse IPv4 only.
985185a700Sflorian.It Fl 6
995185a700SflorianUse IPv6 only.
10065e34726Sschwarze.It Fl b Ar sourceaddr Ns Op Pf # Ar port
10165e34726SschwarzeSet the source IP address of the query, which is useful on machines
10265e34726Sschwarzewith multiple interfaces.
1035185a700SflorianThe
10465e34726Sschwarze.Ar sourceaddr
1055185a700Sflorianmust be a valid address on one of the host's network interfaces, or
106884866f1Sjsg"0.0.0.0" or "::".
107884866f1SjsgAn optional port may be specified by appending "#<port>".
1085185a700Sflorian.It Fl c Ar class
1095185a700SflorianSet the query class.
1105185a700SflorianThe default is
1115185a700Sflorian.Cm IN ;
1125185a700Sflorianother classes are
1135185a700Sflorian.Cm HS
1145185a700Sflorianfor Hesiod records and
1155185a700Sflorian.Cm CH
1165185a700Sflorianfor Chaosnet records.
1175185a700Sflorian.It Fl f Ar file
1185185a700SflorianBatch mode:
1195185a700Sflorian.Nm
1205185a700Sflorianreads a list of lookup requests to process from the given
1215185a700Sflorian.Ar file .
1225185a700SflorianEach line in the file should be organized in the same way they would be
1235185a700Sflorianpresented as queries to
1245185a700Sflorian.Nm
1255185a700Sflorianusing the command-line interface.
1265185a700Sflorian.It Fl h
1275185a700SflorianDisplay a brief summary of command line arguments and options.
1285185a700Sflorian.It Fl i
1295185a700SflorianDo reverse IPv6 lookups using the obsolete RFC 1886 IP6.INT domain, which is no
1305185a700Sflorianlonger in use.
1315185a700SflorianObsolete bit string label queries (RFC 2874) are not attempted.
1325185a700Sflorian.It Fl k Ar keyfile
133591db234SflorianSign queries using TSIG.
134591db234SflorianThe format of the
135591db234Sflorian.Ar keyfile
136591db234Sflorianis as follows:
137591db234Sflorian.Bd -literal -offset indent
138591db234Sfloriankey "keyname" {
139591db234Sflorian	algorithm hmac;
140591db234Sflorian	secret "base64-secret";
141591db234Sflorian};
142591db234Sflorian.Ed
143591db234Sflorian.Pp
144591db234Sflorian.Ar keyname
145591db234Sflorianis the name of the key, and
146591db234Sflorian.Ar base64-secret
147591db234Sflorianis the base64-encoded shared secret.
148591db234Sflorian.Ar hmac
149591db234Sflorianis the name of the key algorithm;
150591db234Sflorianvalid choices are
151591db234Sflorian.Cm hmac-sha1 ,
152591db234Sflorian.Cm hmac-sha224 ,
153591db234Sflorian.Cm hmac-sha256 ,
154591db234Sflorian.Cm hmac-sha384 ,
1555185a700Sflorianand
156591db234Sflorian.Cm hmac-sha512 .
1575185a700Sflorian.It Fl p Ar port
158c5d247d8SjsgSend the query to a non-standard port on the server, instead of the default port
1595185a700Sflorian53.
1605185a700SflorianThis option would be used to test a name server that has been configured to
1615185a700Sflorianlisten for queries on a non-standard port number.
1625185a700Sflorian.It Fl q Ar name
1635185a700SflorianThe domain name to query.
1645185a700SflorianThis is useful to distinguish the
1655185a700Sflorian.Ar name
1665185a700Sflorianfrom other arguments.
1675185a700Sflorian.It Fl t Ar type
1685185a700SflorianThe resource record type to query.
1695185a700SflorianIt can be any valid query type.
1705185a700SflorianIf it is a resource record type supported in BIND 9, it can be given by the
1715185a700Sfloriantype mnemonic (such as
1725185a700Sflorian.Cm NS
1735185a700Sflorianor
1745185a700Sflorian.Cm AAAA ) .
1755185a700SflorianThe default query type is
1765185a700Sflorian.Cm A ,
1775185a700Sflorianunless the
1785185a700Sflorian.Fl x
1795185a700Sflorianoption is supplied to indicate a reverse lookup.
1805185a700SflorianA zone transfer can be requested by specifying a type of
1815185a700Sflorian.Cm AXFR .
1825185a700SflorianWhen an incremental zone transfer is required, set the
1835185a700Sflorian.Ar type
1845185a700Sflorianto
1855185a700Sflorian.Cm IXFR Ns = Ns Ar N .
1865185a700SflorianThe incremental zone transfer will contain the changes made to the zone since
1875185a700Sflorianthe serial number in the zone's SOA record was
1885185a700Sflorian.Ar N .
1895185a700Sflorian.Pp
1905185a700SflorianAll resource record types can be expressed as
1915185a700Sflorian.Cm TYPE Ns Ar nn ,
1925185a700Sflorianwhere
1935185a700Sflorian.Ar nn
1945185a700Sflorianis the number of the type.
1955185a700SflorianIf the resource record type is not supported in BIND 9, the result will be
1965185a700Sfloriandisplayed as described in RFC 3597.
1975185a700Sflorian.It Fl u
1985185a700SflorianPrint query times in microseconds instead of milliseconds.
1995185a700Sflorian.It Fl v
2005185a700SflorianPrint the version number and exit.
2015185a700Sflorian.It Fl x Ar addr
2025185a700SflorianSimplified reverse lookups, for mapping addresses to names.
2035185a700SflorianThe
2045185a700Sflorian.Ar addr
2055185a700Sflorianis an IPv4 address in dotted-decimal notation, or a colon-delimited IPv6
2065185a700Sflorianaddress.
2075185a700SflorianWhen the
2085185a700Sflorian.Fl x
2095185a700Sflorianis used, there is no need to provide the
2105185a700Sflorian.Ar name ,
2115185a700Sflorian.Ar class
2125185a700Sflorianand
2135185a700Sflorian.Ar type
2145185a700Sflorianarguments.
2155185a700Sflorian.Nm
2165185a700Sflorianautomatically performs a lookup for a name like
2175185a700Sflorian.Ql 94.2.0.192.in-addr.arpa
2185185a700Sflorianand sets the query type and class to
2195185a700Sflorian.Cm PTR
2205185a700Sflorianand
2215185a700Sflorian.Cm IN
2225185a700Sflorianrespectively.
2235185a700SflorianIPv6 addresses are looked up using nibble format under the IP6.ARPA domain
2245185a700Sflorian(but see also the
2255185a700Sflorian.Fl i
2265185a700Sflorianoption).
2275185a700Sflorian.It Fl y Xo
2285185a700Sflorian.Op Ar hmac : Ns
2295185a700Sflorian.Ar keyname : Ns
2305185a700Sflorian.Ar secret
2315185a700Sflorian.Xc
2325185a700SflorianSign queries using TSIG with the given authentication key.
2335185a700Sflorian.Ar keyname
2345185a700Sflorianis the name of the key, and
2355185a700Sflorian.Ar secret
2365185a700Sflorianis the base64 encoded shared secret.
2375185a700Sflorian.Ar hmac
2385185a700Sflorianis the name of the key algorithm;
2395185a700Sflorianvalid choices are
240591db234Sflorian.Cm hmac-sha1 ,
241591db234Sflorian.Cm hmac-sha224 ,
242591db234Sflorian.Cm hmac-sha256 ,
243591db234Sflorian.Cm hmac-sha384 ,
244591db234Sflorianand
245591db234Sflorian.Cm hmac-sha512 .
2465185a700SflorianIf
2475185a700Sflorian.Ar hmac
2485185a700Sflorianis not specified, the default is
249591db234Sflorian.Cm hmac-sha256 .
2505185a700Sflorian.Pp
2515185a700SflorianNOTE: You should use the
2525185a700Sflorian.Fl k
2535185a700Sflorianoption and
2545185a700Sflorianavoid the
2555185a700Sflorian.Fl y
2565185a700Sflorianoption, because
2575185a700Sflorianwith
2585185a700Sflorian.Fl y
2595185a700Sflorianthe shared secret is supplied as a command line argument in clear text.
2605185a700SflorianThis may be visible in the output from
2615185a700Sflorian.Xr ps 1
2625185a700Sflorianor in a history file maintained by the user's shell.
2635185a700Sflorian.El
2645185a700Sflorian.Pp
2655185a700SflorianThe
2665185a700Sflorian.Cm IN
2675185a700Sflorianand
2685185a700Sflorian.Cm CH
2695185a700Sflorianclass names overlap with the IN and CH top level domain names.
2705185a700SflorianEither use the
2715185a700Sflorian.Fl t
2725185a700Sflorianand
2735185a700Sflorian.Fl c
2745185a700Sflorianoptions to specify the type and class, use the
2755185a700Sflorian.Fl q
2765185a700Sflorianto specify the domain name, or use "IN." and "CH." when looking up these top
2775185a700Sflorianlevel domains.
2785185a700Sflorian.Sh QUERY OPTIONS
2795185a700Sflorian.Nm
2805185a700Sflorianprovides a number of query options which affect the way in which lookups are
2815185a700Sflorianmade and the results displayed.
2825185a700SflorianSome of
2835185a700Sflorianthese set or reset flag bits in the query header, some determine which sections
2845185a700Sflorianof the answer get printed, and others determine the timeout and retry
2855185a700Sflorianstrategies.
2865185a700Sflorian.Pp
2875185a700SflorianEach query option is identified by a keyword preceded by a plus sign
2885185a700Sflorian.Pq Cm + .
2895185a700SflorianSome keywords set or reset an option.
2905185a700SflorianThese may be preceded by the string
2915185a700Sflorian.Cm no
2925185a700Sflorianto negate the meaning of that keyword.
2935185a700SflorianOther keywords assign values to options like the timeout interval.
2945185a700SflorianThey have the form
2955185a700Sflorian.Cm + Ns Ar keyword Ns = Ns Ar value .
2965185a700SflorianKeywords may be abbreviated, provided the abbreviation is unambiguous; for
2975185a700Sflorianexample,
2985185a700Sflorian.Cm +cd
2995185a700Sflorianis equivalent
3005185a700Sflorianto
3015185a700Sflorian.Cm +cdflag .
3025185a700SflorianThe query options are:
3035185a700Sflorian.Bl -tag -width Ds
3045185a700Sflorian.It Xo
3055185a700Sflorian.Cm + Ns
3065185a700Sflorian.Op Cm no Ns
3075185a700Sflorian.Cm aaflag
3085185a700Sflorian.Xc
3095185a700SflorianA synonym for
3105185a700Sflorian.Cm + Ns
3115185a700Sflorian.Op Cm no Ns
3125185a700Sflorian.Cm aaonly .
3135185a700Sflorian.It Xo
3145185a700Sflorian.Cm + Ns
3155185a700Sflorian.Op Cm no Ns
3165185a700Sflorian.Cm aaonly
3175185a700Sflorian.Xc
3185185a700SflorianSet the "aa" flag in the query (off by default).
3195185a700Sflorian.It Xo
3205185a700Sflorian.Cm + Ns
3215185a700Sflorian.Op Cm no Ns
3225185a700Sflorian.Cm additional
3235185a700Sflorian.Xc
3245185a700SflorianDisplay the additional section of a reply (on by default).
3255185a700Sflorian.It Xo
3265185a700Sflorian.Cm + Ns
3275185a700Sflorian.Op Cm no Ns
3285185a700Sflorian.Cm adflag
3295185a700Sflorian.Xc
3305185a700SflorianSet the AD (authentic data) bit in the query (on by default).
3315185a700SflorianThis requests the server to return whether all of the answer and authority
3325185a700Sfloriansections have all been validated as secure according to the security policy of
3335185a700Sflorianthe server.
3345185a700SflorianAD=1 indicates that all records have been validated as secure and the answer is
3355185a700Sfloriannot from an OPT-OUT range.
3365185a700SflorianAD=0 indicates that some part of the answer was insecure or not validated.
3375185a700Sflorian.It Xo
3385185a700Sflorian.Cm + Ns
3395185a700Sflorian.Op Cm no Ns
3405185a700Sflorian.Cm all
3415185a700Sflorian.Xc
3425185a700SflorianSet or clear all display flags.
3435185a700Sflorian.It Xo
3445185a700Sflorian.Cm + Ns
3455185a700Sflorian.Op Cm no Ns
3465185a700Sflorian.Cm answer
3475185a700Sflorian.Xc
3485185a700SflorianDisplay the answer section of a reply (on by default).
3495185a700Sflorian.It Xo
3505185a700Sflorian.Cm + Ns
3515185a700Sflorian.Op Cm no Ns
3525185a700Sflorian.Cm authority
3535185a700Sflorian.Xc
3545185a700SflorianDisplay the authority section of a reply (on by default).
3555185a700Sflorian.It Xo
3565185a700Sflorian.Cm + Ns
3575185a700Sflorian.Op Cm no Ns
3585185a700Sflorian.Cm besteffort
3595185a700Sflorian.Xc
3605185a700SflorianAttempt to display the contents of messages which are malformed (on by
3615185a700Sfloriandefault).
3625185a700Sflorian.It Cm +bufsize Ns = Ns Ar #
3635185a700SflorianSet the UDP message buffer size advertised using EDNS0 to
3645185a700Sflorian.Ar #
3655185a700Sflorianbytes.
3665185a700SflorianThe maximum and minimum sizes of this buffer are 65535 and 0 respectively.
3675185a700SflorianValues outside this range are rounded up or down appropriately.
3685185a700SflorianValues other than zero will cause an EDNS query to be sent.
3695185a700Sflorian.It Xo
3705185a700Sflorian.Cm + Ns
3715185a700Sflorian.Op Cm no Ns
3725185a700Sflorian.Cm cdflag
3735185a700Sflorian.Xc
3745185a700SflorianSet the CD (checking disabled) bit in the query (off by default).
3755185a700SflorianThis requests the server to not perform DNSSEC validation of responses.
3765185a700Sflorian.It Xo
3775185a700Sflorian.Cm + Ns
3785185a700Sflorian.Op Cm no Ns
3795185a700Sflorian.Cm class
3805185a700Sflorian.Xc
3815185a700SflorianDisplay the CLASS when printing the record (on by default).
3825185a700Sflorian.It Xo
3835185a700Sflorian.Cm + Ns
3845185a700Sflorian.Op Cm no Ns
3855185a700Sflorian.Cm cmd
3865185a700Sflorian.Xc
3875185a700SflorianPrint an initial comment identifying the version of
3885185a700Sflorian.Nm
3895185a700Sflorianand the query options that have been applied (on by default).
3905185a700Sflorian.It Xo
3915185a700Sflorian.Cm + Ns
3925185a700Sflorian.Op Cm no Ns
3935185a700Sflorian.Cm comments
3945185a700Sflorian.Xc
3955185a700SflorianDisplay comment lines in the output (on by default).
3965185a700Sflorian.It Xo
3975185a700Sflorian.Cm + Ns
3985185a700Sflorian.Op Cm no Ns
3995185a700Sflorian.Cm cookie Ns
4005185a700Sflorian.Op = Ns Ar value
4015185a700Sflorian.Xc
4025185a700SflorianSend a COOKIE EDNS option, containing an optional
4035185a700Sflorian.Ar value
4045185a700Sflorian(off by default).
4055185a700SflorianReplaying a COOKIE from a previous response will allow the server to
4065185a700Sflorianidentify a previous client.
4075185a700Sflorian.Pp
4085185a700Sflorian.Cm +cookie
4095185a700Sflorianis automatically set when
4105185a700Sflorian.Cm +trace
4115185a700Sflorianis in use, to better emulate the default queries from a name server.
4125185a700Sflorian.Pp
4135185a700SflorianThis option was formerly called
4145185a700Sflorian.Cm + Ns
4155185a700Sflorian.Op Cm no Ns
4165185a700Sflorian.Cm sit
4175185a700Sflorian(Server Identity Token).
4185185a700SflorianIn BIND 9.10.0 through BIND 9.10.2,
4195185a700Sflorianit sent the experimental option code 65001.
4205185a700SflorianThis was changed to option code 10 in BIND 9.10.3 when the DNS
4215185a700SflorianCOOKIE option was allocated.
4225185a700Sflorian.Pp
4235185a700SflorianThe
4245185a700Sflorian.Cm + Ns
4255185a700Sflorian.Op Cm no Ns
4265185a700Sflorian.Cm sit
4275185a700Sflorianoption is now deprecated, but has been retained as a synonym for
4285185a700Sflorian.Cm + Ns
4295185a700Sflorian.Op Cm no Ns
4305185a700Sflorian.Cm cookie
4315185a700Sflorianfor backward compatibility within the BIND 9.10 branch.
4325185a700Sflorian.It Xo
4335185a700Sflorian.Cm + Ns
4345185a700Sflorian.Op Cm no Ns
4355185a700Sflorian.Cm crypto
4365185a700Sflorian.Xc
4375185a700SflorianDisplay cryptographic fields in DNSSEC records (on by default).
4385185a700SflorianThe contents of these field are unnecessary to debug most DNSSEC validation
4395185a700Sflorianfailures and removing them makes it easier to see the common failures.
4405185a700SflorianWhen omitted they are replaced by the string "[omitted]" or in the DNSKEY case
4415185a700Sflorianthe key id is displayed as the replacement, e.g. "[ key id = value ]".
4425185a700Sflorian.It Xo
4435185a700Sflorian.Cm + Ns
4445185a700Sflorian.Op Cm no Ns
4455185a700Sflorian.Cm defname
4465185a700Sflorian.Xc
4475185a700SflorianDeprecated, treated as a synonym for
4485185a700Sflorian.Cm + Ns
4495185a700Sflorian.Op Cm no Ns
450e9d1bb1dSjmc.Cm search .
4515185a700Sflorian.It Xo
4525185a700Sflorian.Cm + Ns
4535185a700Sflorian.Op Cm no Ns
4545185a700Sflorian.Cm dnssec
4555185a700Sflorian.Xc
4565185a700SflorianRequest DNSSEC records be sent by setting the DNSSEC OK bit (DO) in the OPT
4575185a700Sflorianrecord in the additional section of the query (off by default).
4585185a700Sflorian.It Cm +domain Ns = Ns Ar name
4595185a700SflorianSet the search list to contain the single domain
4605185a700Sflorian.Ar name ,
4615185a700Sflorianas if specified in a
4625185a700Sflorian.Ic domain
4635185a700Sfloriandirective in
4645185a700Sflorian.Xr resolv.conf 5 ,
4655185a700Sflorianand enable search list processing as if the
4665185a700Sflorian.Cm +search
4675185a700Sflorianoption were given (off by default).
4685185a700Sflorian.It Xo
4695185a700Sflorian.Cm + Ns
4705185a700Sflorian.Op Cm no Ns
4715185a700Sflorian.Cm edns Ns
4725185a700Sflorian.Op = Ns Ar #
4735185a700Sflorian.Xc
4745185a700SflorianUse EDNS in the query (on by default).
4755185a700SflorianA version may also be specified, from 0 (the default) to 255.
4765185a700Sflorian.Cm +noedns
4775185a700Sfloriandisables EDNS and clears the remembered version.
4785185a700Sflorian.It Cm +ednsflags Ns Op = Ns Ar #
4795185a700SflorianSet the must-be-zero EDNS flags bits (Z bits)
4805185a700Sflorianto the specified value (0 by default).
4815185a700SflorianDecimal, hex and octal encodings are accepted.
4825185a700SflorianSetting a named flag (e.g. DO) will silently be ignored.
4835185a700Sflorian.It Xo
4845185a700Sflorian.Cm + Ns
4855185a700Sflorian.Op Cm no Ns
4865185a700Sflorian.Cm ednsnegotiation
4875185a700Sflorian.Xc
4885185a700SflorianEnable EDNS version negotiation (off by default).
4895185a700Sflorian.It Xo
4905185a700Sflorian.Cm + Ns
4915185a700Sflorian.Op Cm no Ns
4925185a700Sflorian.Cm ednsopt Ns
4935185a700Sflorian.Op = Ns Ar code Ns Op : Ns Ar value
4945185a700Sflorian.Xc
4955185a700SflorianSpecify EDNS option with code point
4965185a700Sflorian.Ar code
4975185a700Sflorianand optionally payload of
4985185a700Sflorian.Ar value
4995185a700Sflorianas a hexadecimal string.
5005185a700Sflorian.Ar code
5015185a700Sfloriancan be
5025185a700Sflorianeither an EDNS option name (for example,
5035185a700Sflorian.Cm NSID
5045185a700Sflorianor
5055185a700Sflorian.Cm ECS ) ,
5065185a700Sflorianor an arbitrary numeric value.
5075185a700Sflorian.Cm +noednsopt
5085185a700Sflorianclears the EDNS options to be sent.
5095185a700Sflorian.It Xo
5105185a700Sflorian.Cm + Ns
5115185a700Sflorian.Op Cm no Ns
5125185a700Sflorian.Cm expire
5135185a700Sflorian.Xc
5145185a700SflorianSend an EDNS Expire option (off by default).
5155185a700Sflorian.It Xo
5165185a700Sflorian.Cm + Ns
5175185a700Sflorian.Op Cm no Ns
5185185a700Sflorian.Cm fail
5195185a700Sflorian.Xc
5205185a700SflorianDo not try the next server if you receive a SERVFAIL.
5215185a700SflorianThis option is on by default,
5225185a700Sflorianwhich is the reverse of normal stub resolver behavior.
5235185a700Sflorian.It Xo
5245185a700Sflorian.Cm + Ns
5255185a700Sflorian.Op Cm no Ns
5265185a700Sflorian.Cm identify
5275185a700Sflorian.Xc
5285185a700SflorianShow the IP address and port number that supplied the answer (off by default).
5295185a700SflorianThis option has no effect unless the
5305185a700Sflorian.Cm +short
5315185a700Sflorianoption is enabled.
5325185a700Sflorian.It Xo
5335185a700Sflorian.Cm + Ns
5345185a700Sflorian.Op Cm no Ns
5355185a700Sflorian.Cm idnout
5365185a700Sflorian.Xc
5375185a700SflorianConvert puny code on output.
5385185a700SflorianThis version of
5395185a700Sflorian.Nm
5405185a700Sfloriandoes not support IDN.
5415185a700Sflorian.It Xo
5425185a700Sflorian.Cm + Ns
5435185a700Sflorian.Op Cm no Ns
5445185a700Sflorian.Cm ignore
5455185a700Sflorian.Xc
5465185a700SflorianIgnore truncation in UDP responses.
5475185a700SflorianThis option is off by default, which means truncated responses
5485185a700Sfloriancause retrying with TCP.
5495185a700Sflorian.It Xo
5505185a700Sflorian.Cm + Ns
5515185a700Sflorian.Op Cm no Ns
5525185a700Sflorian.Cm keepopen
5535185a700Sflorian.Xc
5545185a700SflorianKeep the TCP socket open between queries and reuse it.
5555185a700SflorianThis option is off by default, which means that a new TCP socket
5565185a700Sflorianis created for each lookup.
5575185a700Sflorian.It Xo
5585185a700Sflorian.Cm + Ns
5595185a700Sflorian.Op Cm no Ns
5605185a700Sflorian.Cm multiline
5615185a700Sflorian.Xc
5625185a700SflorianPrint records like the SOA records in a verbose multi-line format with
5635185a700Sflorianhuman-readable comments.
5645185a700SflorianThis option is off by default, which means that each record is
5655185a700Sflorianprinted on a single line to facilitate machine parsing of the
5665185a700Sflorian.Nm
5675185a700Sflorianoutput.
5685185a700Sflorian.It Cm +ndots Ns = Ns Ar #
5695185a700SflorianSet the number of dots that have to appear in
5705185a700Sflorian.Ar name
5715185a700Sflorianto
5725185a700Sflorian.Ar #
5735185a700Sflorianfor it to be considered absolute.
5745185a700SflorianThe default value is that defined using the ndots statement in
5755185a700Sflorian.Xr resolv.conf 5 ,
5765185a700Sflorianor 1 if no ndots statement is present.
5775185a700SflorianNames with fewer dots are interpreted as relative names and will be searched
5785185a700Sflorianfor in the domains listed in the
5795185a700Sflorian.Cm search
5805185a700Sflorianor
5815185a700Sflorian.Cm domain
5825185a700Sfloriandirective in
5835185a700Sflorian.Xr resolv.conf 5
5845185a700Sflorianif
5855185a700Sflorian.Cm +search
5865185a700Sflorianis set.
5875185a700Sflorian.It Xo
5885185a700Sflorian.Cm + Ns
5895185a700Sflorian.Op Cm no Ns
5905185a700Sflorian.Cm nsid
5915185a700Sflorian.Xc
5925185a700SflorianInclude an EDNS name server ID request when sending a query (off by default).
5935185a700Sflorian.It Xo
5945185a700Sflorian.Cm + Ns
5955185a700Sflorian.Op Cm no Ns
5965185a700Sflorian.Cm nssearch
5975185a700Sflorian.Xc
5985185a700SflorianAttempt to find the authoritative name servers for the zone
5995185a700Sfloriancontaining the name being looked up and display the SOA record
6005185a700Sflorianthat each name server has for the zone (off by default).
6015185a700Sflorian.It Xo
6025185a700Sflorian.Cm + Ns
6035185a700Sflorian.Op Cm no Ns
6045185a700Sflorian.Cm onesoa
6055185a700Sflorian.Xc
6065185a700SflorianPrint only one (starting) SOA record when performing an
6075185a700Sflorian.Cm AXFR .
6085185a700SflorianThis option is off by default, which means that both the starting
6095185a700Sflorianand the ending SOA records are printed.
6105185a700Sflorian.It Xo
6115185a700Sflorian.Cm + Ns
6125185a700Sflorian.Op Cm no Ns
6135185a700Sflorian.Cm opcode Ns = Ns
6145185a700Sflorian.Ar #
6155185a700Sflorian.Xc
6165185a700SflorianSet or restore the DNS message opcode to the specified value,
6175185a700Sflorianwhich can be
6185185a700Sflorian.Cm QUERY Pq the default ,
6195185a700Sflorian.Cm IQUERY ,
6205185a700Sflorian.Cm STATUS ,
6215185a700Sflorian.Cm NOTIFY ,
6225185a700Sflorian.Cm UPDATE ,
6235185a700Sflorianor an integer number in the range from 0 to 15.
6245185a700Sflorian.It Xo
6255185a700Sflorian.Cm + Ns
6265185a700Sflorian.Op Cm no Ns
6275185a700Sflorian.Cm qr
6285185a700Sflorian.Xc
6295185a700SflorianPrint the query as it is sent (off by default).
6305185a700Sflorian.It Xo
6315185a700Sflorian.Cm + Ns
6325185a700Sflorian.Op Cm no Ns
6335185a700Sflorian.Cm question
6345185a700Sflorian.Xc
6355185a700SflorianPrint the question section of a query as a comment when an answer
6365185a700Sflorianis returned (on by default).
6375185a700Sflorian.It Xo
6385185a700Sflorian.Cm + Ns
6395185a700Sflorian.Op Cm no Ns
6405185a700Sflorian.Cm rdflag
6415185a700Sflorian.Xc
6425185a700SflorianA synonym for
6435185a700Sflorian.Cm + Ns
6445185a700Sflorian.Op Cm no Ns
645e9d1bb1dSjmc.Cm recurse .
6465185a700Sflorian.It Xo
6475185a700Sflorian.Cm + Ns
6485185a700Sflorian.Op Cm no Ns
6495185a700Sflorian.Cm recurse
6505185a700Sflorian.Xc
6515185a700SflorianSet the RD (recursion desired) bit in the query (on by default).
6525185a700SflorianRecursion is automatically disabled when the
6535185a700Sflorian.Cm +nssearch
6545185a700Sflorianor
6555185a700Sflorian.Cm +trace
6565185a700Sflorianquery options are used.
6575185a700Sflorian.It Cm +retry Ns = Ns Ar #
6585185a700SflorianSet the number of times to retry UDP queries to server to
6595185a700Sflorian.Ar # .
6605185a700SflorianThe default is 2.
6615185a700SflorianUnlike
6625185a700Sflorian.Cm +tries ,
6635185a700Sflorianthis does not include the initial query.
6645185a700Sflorian.It Xo
6655185a700Sflorian.Cm + Ns
6665185a700Sflorian.Op Cm no Ns
6675185a700Sflorian.Cm rrcomments
6685185a700Sflorian.Xc
6695185a700SflorianDisplay per-record comments in the output (for example,
6705185a700Sflorianhuman-readable key information about DNSKEY records).
6715185a700SflorianThe default is
6725185a700Sflorian.Cm +rrcomments
6735185a700Sflorianif
6745185a700Sflorian.Cm +multiline
6755185a700Sflorianmode is active or
6765185a700Sflorian.Cm +norrcomments
6775185a700Sflorianotherwise.
6785185a700Sflorian.It Xo
6795185a700Sflorian.Cm + Ns
6805185a700Sflorian.Op Cm no Ns
6815185a700Sflorian.Cm search
6825185a700Sflorian.Xc
6835185a700SflorianUse the search list defined by the searchlist or domain directive in
6845185a700Sflorian.Xr resolv.conf 5 ,
6855185a700Sflorianif any (off by default).
6865185a700Sflorian\&'ndots' from
6875185a700Sflorian.Xr resolv.conf 5
6885185a700Sflorian(default 1), which may be overridden by
6895185a700Sflorian.Cm +ndots ,
6905185a700Sfloriandetermines if the name will be treated as relative or not and hence whether a
6915185a700Sfloriansearch is eventually performed or not.
6925185a700Sflorian.It Xo
6935185a700Sflorian.Cm + Ns
6945185a700Sflorian.Op Cm no Ns
6955185a700Sflorian.Cm short
6965185a700Sflorian.Xc
6975185a700SflorianProvide a terse answer (off by default).
6985185a700Sflorian.It Xo
6995185a700Sflorian.Cm + Ns
7005185a700Sflorian.Op Cm no Ns
7015185a700Sflorian.Cm showsearch
7025185a700Sflorian.Xc
7035185a700SflorianPerform a search showing intermediate results (off by default).
7045185a700Sflorian.It Xo
7055185a700Sflorian.Cm + Ns
7065185a700Sflorian.Op Cm no Ns
7075185a700Sflorian.Cm split Ns = Ns Ar #
7085185a700Sflorian.Xc
7095185a700SflorianSplit long hex- or base64-formatted fields in resource records into chunks of
7105185a700Sflorian.Ar #
7115185a700Sfloriancharacters (where
7125185a700Sflorian.Ar #
7135185a700Sflorianis rounded up to the nearest multiple of 4).
7145185a700Sflorian.Cm +nosplit
7155185a700Sflorianor
7165185a700Sflorian.Cm +split Ns =0
7175185a700Sfloriancauses fields not to be split at all.
7185185a700SflorianThe default is 56 characters, or 44 characters when
7195185a700Sflorian.Cm +multiline
7205185a700Sflorianmode is active.
7215185a700Sflorian.It Xo
7225185a700Sflorian.Cm + Ns
7235185a700Sflorian.Op Cm no Ns
7245185a700Sflorian.Cm stats
7255185a700Sflorian.Xc
7265185a700SflorianPrint statistics:
7275185a700Sflorianwhen the query was made, the size of the reply and so on (on by default).
7285185a700Sflorian.It Xo
7295185a700Sflorian.Cm + Ns
7305185a700Sflorian.Op Cm no Ns
7315185a700Sflorian.Cm subnet Ns = Ns
7325185a700Sflorian.Ar addr Ns
7335185a700Sflorian.Op / Ns Ar prefix
7345185a700Sflorian.Xc
7355185a700SflorianSend an EDNS Client Subnet option with the specified IP address or
7365185a700Sfloriannetwork prefix (off by default).
7375185a700Sflorian.Pp
7385185a700Sflorian.Nm
7395185a700Sflorian.Cm +subnet Ns =0.0.0.0/0,
7405185a700Sflorianor simply
7415185a700Sflorian.Nm
7425185a700Sflorian.Cm +subnet Ns =0
7435185a700Sflorianfor short, sends an EDNS CLIENT-SUBNET option with an empty address and a
7445185a700Sfloriansource prefix-length of zero, which signals a resolver that the client's address
7455185a700Sflorianinformation must
7465185a700Sflorian.Em not
7475185a700Sflorianbe used when resolving this query.
7485185a700Sflorian.It Xo
7495185a700Sflorian.Cm + Ns
7505185a700Sflorian.Op Cm no Ns
7515185a700Sflorian.Cm tcp
7525185a700Sflorian.Xc
7535185a700SflorianUse TCP when querying name servers (off by default).
7545185a700Sflorian.Cm IXFR Ns = Ns Ar N
7555185a700Sflorianqueries use TCP unless it is explicitly disabled with
7565185a700Sflorian.Cm +notcp .
7575185a700Sflorian.Cm AXFR
7585185a700Sflorianqueries always use TCP.
7595185a700Sflorian.It Cm +timeout Ns = Ns Ar #
7605185a700SflorianSet the timeout for a query to
7615185a700Sflorian.Ar #
7625185a700Sflorianseconds.
7635185a700SflorianThe default is 5 seconds for UDP and 10 seconds for TCP.
7645185a700SflorianAn attempt to set
7655185a700Sflorian.Ar #
7665185a700Sflorianto less than 1 will result in a query timeout of 1 second being applied.
7675185a700Sflorian.It Xo
7685185a700Sflorian.Cm + Ns
7695185a700Sflorian.Op Cm no Ns
7705185a700Sflorian.Cm trace
7715185a700Sflorian.Xc
7725185a700SflorianTrace the delegation path from the root name servers for the name
7735185a700Sflorianbeing looked up (off by default).
7745185a700Sflorian.Pp
7755185a700SflorianWhen tracing is enabled,
7765185a700Sflorian.Nm
7775185a700Sflorianmakes iterative queries to resolve the name being looked up.
7785185a700SflorianIt will follow referrals from the root servers, showing the answer from each
7795185a700Sflorianserver that was used to resolve the lookup.
7805185a700Sflorian.Pp
7815185a700SflorianIf @server is also specified, it affects only the initial query for the root
7825185a700Sflorianzone name servers.
7835185a700Sflorian.Pp
7845185a700Sflorian.Cm +dnssec
7855185a700Sflorianis also set when
7865185a700Sflorian.Cm +trace
7875185a700Sflorianis set to better emulate the default queries from a name server.
7885185a700Sflorian.It Cm +tries Ns = Ns Ar #
7895185a700SflorianSet the number of times to try UDP queries to server to
7905185a700Sflorian.Ar # .
7915185a700SflorianThe default is 3.
7925185a700SflorianIf
7935185a700Sflorian.Ar #
7945185a700Sflorianis less than or equal to zero, the number of tries is silently rounded up to 1.
7955185a700Sflorian.It Xo
7965185a700Sflorian.Cm + Ns
7975185a700Sflorian.Op Cm no Ns
7985185a700Sflorian.Cm ttlid
7995185a700Sflorian.Xc
8005185a700SflorianDisplay the TTL when printing the record (on by default).
8015185a700Sflorian.It Xo
8025185a700Sflorian.Cm + Ns
8035185a700Sflorian.Op Cm no Ns
8045185a700Sflorian.Cm vc
8055185a700Sflorian.Xc
8065185a700SflorianUse TCP when querying name servers.
8075185a700SflorianThis alternate syntax to
8085185a700Sflorian.Cm + Ns
8095185a700Sflorian.Op Cm no Ns
8105185a700Sflorian.Cm tcp
8115185a700Sflorianis provided for backwards compatibility.
8125185a700SflorianThe "vc" stands for "virtual circuit".
813*9835a5e1Sflorian.It Xo
814*9835a5e1Sflorian.Cm + Ns
815*9835a5e1Sflorian.Op Cm no Ns
816*9835a5e1Sflorian.Cm zoneversion
817*9835a5e1Sflorian.Xc
818*9835a5e1SflorianInclude an EDNS zone version request when sending a query (off by default).
8195185a700Sflorian.El
8205185a700Sflorian.Sh MULTIPLE QUERIES
8215185a700SflorianThe BIND 9 implementation of
8225185a700Sflorian.Nm
8235185a700Sfloriansupports specifying multiple queries on the command line (in addition to
8245185a700Sfloriansupporting the
8255185a700Sflorian.Fl f
8265185a700Sflorianbatch file option).
8275185a700SflorianEach of those queries can be supplied with its own set of flags, options and
8285185a700Sflorianquery options.
8295185a700Sflorian.Pp
8305185a700SflorianIn this case, each
8315185a700Sflorian.Ar query
8325185a700Sflorianargument represent an individual query in the command-line syntax described
8335185a700Sflorianabove.
8345185a700SflorianEach consists of any of the standard options and flags, the name to be looked
8355185a700Sflorianup, an optional query type and class and any query options that should be
8365185a700Sflorianapplied to that query.
8375185a700Sflorian.Pp
8385185a700SflorianA global set of query options, which should be applied to all queries, can
8395185a700Sflorianalso be supplied.
8405185a700SflorianThese global query options must precede the first tuple of name, class, type,
8415185a700Sflorianoptions, flags, and query options supplied on the command line.
8425185a700SflorianAny global query options (except the
8435185a700Sflorian.Cm + Ns
8445185a700Sflorian.Op Cm no Ns
8455185a700Sflorian.Cm cmd
8465185a700Sflorianoption) can be overridden by a query-specific set of query options.
8475185a700SflorianFor example:
8485185a700Sflorian.Bd -literal -offset indent
8495185a700Sfloriandig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
8505185a700Sflorian.Ed
8515185a700Sflorian.Pp
8525185a700Sflorianshows how
8535185a700Sflorian.Nm
8545185a700Sfloriancould be used from the command line to make three lookups: an ANY query for
8555185a700Sflorianwww.isc.org, a reverse lookup of 127.0.0.1 and a query for the NS records of
8565185a700Sflorianisc.org.
8575185a700SflorianA global query option of
8585185a700Sflorian.Cm +qr
8595185a700Sflorianis applied, so that
8605185a700Sflorian.Nm
8615185a700Sflorianshows the initial query it made for each lookup.
8625185a700SflorianThe final query has a local query option of
8635185a700Sflorian.Cm +noqr
8645185a700Sflorianwhich means that
8655185a700Sflorian.Nm
8665185a700Sflorianwill not print the initial query when it looks up the NS records for
8675185a700Sflorianisc.org.
8685185a700Sflorian.Sh FILES
8695185a700Sflorian.Bl -tag -width Ds
8705185a700Sflorian.It Pa /etc/resolv.conf
8715185a700SflorianResolver configuration file.
8725185a700Sflorian.El
8735185a700Sflorian.Sh SEE ALSO
8745185a700Sflorian.Xr host 1 ,
8755185a700Sflorian.Xr resolv.conf 5
8765185a700Sflorian.Sh STANDARDS
8775185a700Sflorian.Rs
8785185a700Sflorian.%A P. Mockapetris
8795185a700Sflorian.%D November 1987
8805185a700Sflorian.%R RFC 1035
8815185a700Sflorian.%T Domain Names - Implementation and Specification
8825185a700Sflorian.Re
8835185a700Sflorian.Sh AUTHORS
8845185a700Sflorian.An -nosplit
8855185a700Sflorian.An Internet Systems Consortium, Inc .
8865185a700Sflorian.Sh BUGS
8875185a700SflorianThere are probably too many query options.
888