2021-06-03 08:37:05 +02:00
|
|
|
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2019-03-31 12:49:47 +02:00
|
|
|
..
|
2021-06-03 08:37:05 +02:00
|
|
|
.. SPDX-License-Identifier: MPL-2.0
|
|
|
|
..
|
|
|
|
.. This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
.. License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
..
|
|
|
|
.. See the COPYRIGHT file distributed with this work for additional
|
|
|
|
.. information regarding copyright ownership.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
.. highlight: console
|
|
|
|
|
2022-03-02 16:36:34 +01:00
|
|
|
.. program:: dig
|
2019-03-31 12:49:47 +02:00
|
|
|
.. _man_dig:
|
|
|
|
|
|
|
|
dig - DNS lookup utility
|
2020-06-29 19:39:03 +02:00
|
|
|
------------------------
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
Synopsis
|
|
|
|
~~~~~~~~
|
|
|
|
:program:`dig` [@server] [**-b** address] [**-c** class] [**-f** filename] [**-k** filename] [**-m**] [**-p** port#] [**-q** name] [**-t** type] [**-v**] [**-x** addr] [**-y** [hmac:]name:key] [ [**-4**] | [**-6**] ] [name] [type] [class] [queryopt...]
|
|
|
|
|
|
|
|
:program:`dig` [**-h**]
|
|
|
|
|
|
|
|
:program:`dig` [global-queryopt...] [query...]
|
|
|
|
|
|
|
|
Description
|
|
|
|
~~~~~~~~~~~
|
|
|
|
|
|
|
|
``dig`` is a flexible tool for interrogating DNS name servers. It
|
|
|
|
performs DNS lookups and displays the answers that are returned from the
|
|
|
|
name server(s) that were queried. Most DNS administrators use ``dig`` to
|
2020-06-04 00:24:08 +00:00
|
|
|
troubleshoot DNS problems because of its flexibility, ease of use, and
|
2019-03-31 12:49:47 +02:00
|
|
|
clarity of output. Other lookup tools tend to have less functionality
|
|
|
|
than ``dig``.
|
|
|
|
|
|
|
|
Although ``dig`` is normally used with command-line arguments, it also
|
|
|
|
has a batch mode of operation for reading lookup requests from a file. A
|
|
|
|
brief summary of its command-line arguments and options is printed when
|
2022-03-03 15:02:10 +00:00
|
|
|
the :option:`-h` option is given. The BIND 9
|
2019-03-31 12:49:47 +02:00
|
|
|
implementation of ``dig`` allows multiple lookups to be issued from the
|
|
|
|
command line.
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
Unless it is told to query a specific name server, ``dig`` tries each
|
2019-03-31 12:49:47 +02:00
|
|
|
of the servers listed in ``/etc/resolv.conf``. If no usable server
|
2020-06-04 00:24:08 +00:00
|
|
|
addresses are found, ``dig`` sends the query to the local host.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
When no command-line arguments or options are given, ``dig``
|
|
|
|
performs an NS query for "." (the root).
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
It is possible to set per-user defaults for ``dig`` via
|
|
|
|
``${HOME}/.digrc``. This file is read and any options in it are applied
|
2022-03-02 16:54:31 +01:00
|
|
|
before the command-line arguments. The :option:`-r` option disables this
|
2020-06-04 00:24:08 +00:00
|
|
|
feature, for scripts that need predictable behavior.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
The IN and CH class names overlap with the IN and CH top-level domain
|
2022-03-02 16:54:31 +01:00
|
|
|
names. Either use the :option:`-t` and :option:`-c` options to specify the type and
|
|
|
|
class, use the :option:`-q` to specify the domain name, or use "IN." and
|
2020-06-04 00:24:08 +00:00
|
|
|
"CH." when looking up these top-level domains.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
Simple Usage
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
|
|
A typical invocation of ``dig`` looks like:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
dig @server name type
|
|
|
|
|
|
|
|
where:
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: server
|
|
|
|
|
2019-03-31 12:49:47 +02:00
|
|
|
is the name or IP address of the name server to query. This can be an
|
|
|
|
IPv4 address in dotted-decimal notation or an IPv6 address in
|
|
|
|
colon-delimited notation. When the supplied ``server`` argument is a
|
|
|
|
hostname, ``dig`` resolves that name before querying that name
|
|
|
|
server.
|
|
|
|
|
|
|
|
If no ``server`` argument is provided, ``dig`` consults
|
|
|
|
``/etc/resolv.conf``; if an address is found there, it queries the
|
2022-03-02 16:54:31 +01:00
|
|
|
name server at that address. If either of the :option:`-4` or :option:`-6`
|
2019-03-31 12:49:47 +02:00
|
|
|
options are in use, then only addresses for the corresponding
|
2020-06-04 00:24:08 +00:00
|
|
|
transport are tried. If no usable addresses are found, ``dig``
|
|
|
|
sends the query to the local host. The reply from the name server
|
2019-03-31 12:49:47 +02:00
|
|
|
that responds is displayed.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: name
|
|
|
|
|
2019-03-31 12:49:47 +02:00
|
|
|
is the name of the resource record that is to be looked up.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: type
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
indicates what type of query is required - ANY, A, MX, SIG, etc.
|
2019-03-31 12:49:47 +02:00
|
|
|
``type`` can be any valid query type. If no ``type`` argument is
|
2020-06-04 00:24:08 +00:00
|
|
|
supplied, ``dig`` performs a lookup for an A record.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
Options
|
|
|
|
~~~~~~~
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -4
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option indicates that only IPv4 should be used.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -6
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option indicates that only IPv6 should be used.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -b address[#port]
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets the source IP address of the query. The ``address`` must be a
|
2019-03-31 12:49:47 +02:00
|
|
|
valid address on one of the host's network interfaces, or "0.0.0.0"
|
2020-06-04 00:24:08 +00:00
|
|
|
or "::". An optional port may be specified by appending ``#port``.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -c class
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets the query class. The default ``class`` is IN; other classes are
|
2019-03-31 12:49:47 +02:00
|
|
|
HS for Hesiod records or CH for Chaosnet records.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -f file
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets batch mode, in which ``dig`` reads a list of lookup requests to process from
|
2019-03-31 12:49:47 +02:00
|
|
|
the given ``file``. Each line in the file should be organized in the
|
2020-06-04 00:24:08 +00:00
|
|
|
same way it would be presented as a query to ``dig`` using the
|
2019-03-31 12:49:47 +02:00
|
|
|
command-line interface.
|
|
|
|
|
2022-03-03 15:02:10 +00:00
|
|
|
.. option:: -h
|
|
|
|
|
|
|
|
Print a usage summary.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -k keyfile
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option tells ``named`` to sign queries using TSIG using a key read from the given file. Key
|
|
|
|
files can be generated using ``tsig-keygen``. When using TSIG
|
2019-03-31 12:49:47 +02:00
|
|
|
authentication with ``dig``, the name server that is queried needs to
|
|
|
|
know the key and algorithm that is being used. In BIND, this is done
|
|
|
|
by providing appropriate ``key`` and ``server`` statements in
|
|
|
|
``named.conf``.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -m
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option enables memory usage debugging.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -p port
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sends the query to a non-standard port on the server, instead of the
|
|
|
|
default port 53. This option is used to test a name server that
|
2019-03-31 12:49:47 +02:00
|
|
|
has been configured to listen for queries on a non-standard port
|
|
|
|
number.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -q name
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option specifies the domain name to query. This is useful to distinguish the ``name``
|
2019-03-31 12:49:47 +02:00
|
|
|
from other arguments.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -r
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option indicates that options from ``${HOME}/.digrc`` should not be read. This is useful for
|
|
|
|
scripts that need predictable behavior.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -t type
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option indicates the resource record type to query, which can be any valid query type. If
|
2019-03-31 12:49:47 +02:00
|
|
|
it is a resource record type supported in BIND 9, it can be given by
|
2020-06-04 00:24:08 +00:00
|
|
|
the type mnemonic (such as ``NS`` or ``AAAA``). The default query type is
|
2022-03-02 16:54:31 +01:00
|
|
|
``A``, unless the :option:`-x` option is supplied to indicate a reverse
|
2019-03-31 12:49:47 +02:00
|
|
|
lookup. A zone transfer can be requested by specifying a type of
|
|
|
|
AXFR. When an incremental zone transfer (IXFR) is required, set the
|
2020-06-04 00:24:08 +00:00
|
|
|
``type`` to ``ixfr=N``. The incremental zone transfer contains
|
|
|
|
all changes made to the zone since the serial number in the zone's
|
2019-03-31 12:49:47 +02:00
|
|
|
SOA record was ``N``.
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
All resource record types can be expressed as ``TYPEnn``, where ``nn`` is
|
2019-03-31 12:49:47 +02:00
|
|
|
the number of the type. If the resource record type is not supported
|
2020-06-04 00:24:08 +00:00
|
|
|
in BIND 9, the result is displayed as described in :rfc:`3597`.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -u
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option indicates that print query times should be provided in microseconds instead of milliseconds.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -v
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option prints the version number and exits.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -x addr
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets simplified reverse lookups, for mapping addresses to names. The
|
2019-03-31 12:49:47 +02:00
|
|
|
``addr`` is an IPv4 address in dotted-decimal notation, or a
|
2022-03-02 16:54:31 +01:00
|
|
|
colon-delimited IPv6 address. When the :option:`-x` option is used, there is no
|
2020-06-04 00:24:08 +00:00
|
|
|
need to provide the ``name``, ``class``, and ``type`` arguments.
|
2019-03-31 12:49:47 +02:00
|
|
|
``dig`` automatically performs a lookup for a name like
|
|
|
|
``94.2.0.192.in-addr.arpa`` and sets the query type and class to PTR
|
|
|
|
and IN respectively. IPv6 addresses are looked up using nibble format
|
|
|
|
under the IP6.ARPA domain.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: -y [hmac:]keyname:secret
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option signs queries using TSIG with the given authentication key.
|
|
|
|
``keyname`` is the name of the key, and ``secret`` is the
|
|
|
|
base64-encoded shared secret. ``hmac`` is the name of the key algorithm;
|
2019-03-31 12:49:47 +02:00
|
|
|
valid choices are ``hmac-md5``, ``hmac-sha1``, ``hmac-sha224``,
|
|
|
|
``hmac-sha256``, ``hmac-sha384``, or ``hmac-sha512``. If ``hmac`` is
|
2020-06-04 00:24:08 +00:00
|
|
|
not specified, the default is ``hmac-md5``; if MD5 was disabled, the default is
|
2019-03-31 12:49:47 +02:00
|
|
|
``hmac-sha256``.
|
|
|
|
|
2022-03-02 16:54:31 +01:00
|
|
|
.. note:: Only the :option:`-k` option should be used, rather than the :option:`-y` option,
|
|
|
|
because with :option:`-y` the shared secret is supplied as a command-line
|
2020-06-04 00:24:08 +00:00
|
|
|
argument in clear text. This may be visible in the output from ``ps1`` or
|
2019-03-31 12:49:47 +02:00
|
|
|
in a history file maintained by the user's shell.
|
|
|
|
|
|
|
|
Query Options
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
``dig`` provides a number of query options which affect the way in which
|
|
|
|
lookups are made and the results displayed. Some of these set or reset
|
|
|
|
flag bits in the query header, some determine which sections of the
|
|
|
|
answer get printed, and others determine the timeout and retry
|
|
|
|
strategies.
|
|
|
|
|
|
|
|
Each query option is identified by a keyword preceded by a plus sign
|
2020-06-04 00:24:08 +00:00
|
|
|
(``+``). Some keywords set or reset an option; these may be preceded by
|
2019-03-31 12:49:47 +02:00
|
|
|
the string ``no`` to negate the meaning of that keyword. Other keywords
|
2020-06-04 00:24:08 +00:00
|
|
|
assign values to options, like the timeout interval. They have the form
|
2019-03-31 12:49:47 +02:00
|
|
|
``+keyword=value``. Keywords may be abbreviated, provided the
|
|
|
|
abbreviation is unambiguous; for example, ``+cd`` is equivalent to
|
|
|
|
``+cdflag``. The query options are:
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]aaflag
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option is a synonym for ``+[no]aaonly``.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]aaonly
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets the ``aa`` flag in the query.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]additional
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option displays [or does not display] the additional section of a reply. The
|
2019-03-31 12:49:47 +02:00
|
|
|
default is to display it.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]adflag
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets [or does not set] the AD (authentic data) bit in the query. This
|
2019-03-31 12:49:47 +02:00
|
|
|
requests the server to return whether all of the answer and authority
|
2020-06-04 00:24:08 +00:00
|
|
|
sections have been validated as secure, according to the security
|
|
|
|
policy of the server. ``AD=1`` indicates that all records have been
|
|
|
|
validated as secure and the answer is not from a OPT-OUT range. ``AD=0``
|
|
|
|
indicates that some part of the answer was insecure or not validated.
|
2019-03-31 12:49:47 +02:00
|
|
|
This bit is set by default.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]all
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets or clears all display flags.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]answer
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option displays [or does not display] the answer section of a reply. The default
|
2019-03-31 12:49:47 +02:00
|
|
|
is to display it.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]authority
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option displays [or does not display] the authority section of a reply. The
|
2019-03-31 12:49:47 +02:00
|
|
|
default is to display it.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]badcookie
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option retries the lookup with a new server cookie if a BADCOOKIE response is
|
2019-03-31 12:49:47 +02:00
|
|
|
received.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]besteffort
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option attempts to display the contents of messages which are malformed. The
|
2019-03-31 12:49:47 +02:00
|
|
|
default is to not display malformed answers.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +bufsize[=B]
|
|
|
|
|
2020-07-29 12:34:54 +10:00
|
|
|
This option sets the UDP message buffer size advertised using EDNS0 to
|
|
|
|
``B`` bytes. The maximum and minimum sizes of this buffer are 65535 and
|
|
|
|
0, respectively. ``+bufsize`` restores the default buffer size.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]cdflag
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets [or does not set] the CD (checking disabled) bit in the query. This
|
2019-03-31 12:49:47 +02:00
|
|
|
requests the server to not perform DNSSEC validation of responses.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]class
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option displays [or does not display] the CLASS when printing the record.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]cmd
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles the printing of the initial comment in the output, identifying the
|
|
|
|
version of ``dig`` and the query options that have been applied. This option
|
|
|
|
always has a global effect; it cannot be set globally and then overridden on a
|
|
|
|
per-lookup basis. The default is to print this comment.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]comments
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles the display of some comment lines in the output, with
|
2019-03-31 12:49:47 +02:00
|
|
|
information about the packet header and OPT pseudosection, and the names of
|
2020-06-04 00:24:08 +00:00
|
|
|
the response section. The default is to print these comments.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
Other types of comments in the output are not affected by this option, but
|
2020-06-04 00:24:08 +00:00
|
|
|
can be controlled using other command-line switches. These include
|
2019-03-31 12:49:47 +02:00
|
|
|
``+[no]cmd``, ``+[no]question``, ``+[no]stats``, and ``+[no]rrcomments``.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]cookie=####
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sends [or does not send] a COOKIE EDNS option, with an optional value. Replaying a COOKIE
|
|
|
|
from a previous response allows the server to identify a previous
|
2019-03-31 12:49:47 +02:00
|
|
|
client. The default is ``+cookie``.
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
``+cookie`` is also set when ``+trace`` is set to better emulate the
|
2019-03-31 12:49:47 +02:00
|
|
|
default queries from a nameserver.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]crypto
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles the display of cryptographic fields in DNSSEC records. The
|
|
|
|
contents of these fields are unnecessary for debugging most DNSSEC
|
2019-03-31 12:49:47 +02:00
|
|
|
validation failures and removing them makes it easier to see the
|
2020-06-04 00:24:08 +00:00
|
|
|
common failures. The default is to display the fields. When omitted,
|
|
|
|
they are replaced by the string ``[omitted]`` or, in the DNSKEY case, the
|
|
|
|
key ID is displayed as the replacement, e.g. ``[ key id = value ]``.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]defname
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option, which is deprecated, is treated as a synonym for ``+[no]search``.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]dns64prefix
|
|
|
|
|
2019-07-25 20:26:13 +10:00
|
|
|
Lookup IPV4ONLY.ARPA AAAA and print any DNS64 prefixes found.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]dnssec
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option requests that DNSSEC records be sent by setting the DNSSEC OK (DO) bit in
|
2019-03-31 12:49:47 +02:00
|
|
|
the OPT record in the additional section of the query.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +domain=somename
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets the search list to contain the single domain ``somename``, as if
|
2019-03-31 12:49:47 +02:00
|
|
|
specified in a ``domain`` directive in ``/etc/resolv.conf``, and
|
2020-06-04 00:24:08 +00:00
|
|
|
enables search list processing as if the ``+search`` option were
|
2019-03-31 12:49:47 +02:00
|
|
|
given.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +dscp=value
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets the DSCP code point to be used when sending the query. Valid DSCP
|
|
|
|
code points are in the range [0...63]. By default no code point is
|
2019-03-31 12:49:47 +02:00
|
|
|
explicitly set.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]edns[=#]
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option specifies the EDNS version to query with. Valid values are 0 to 255.
|
|
|
|
Setting the EDNS version causes an EDNS query to be sent.
|
2019-03-31 12:49:47 +02:00
|
|
|
``+noedns`` clears the remembered EDNS version. EDNS is set to 0 by
|
|
|
|
default.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]ednsflags[=#]
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets the must-be-zero EDNS flags bits (Z bits) to the specified value.
|
|
|
|
Decimal, hex, and octal encodings are accepted. Setting a named flag
|
|
|
|
(e.g., DO) is silently ignored. By default, no Z bits are set.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]ednsnegotiation
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option enables/disables EDNS version negotiation. By default, EDNS version
|
2019-03-31 12:49:47 +02:00
|
|
|
negotiation is enabled.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]ednsopt[=code[:value]]
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option specifies the EDNS option with code point ``code`` and an optional payload
|
2019-03-31 12:49:47 +02:00
|
|
|
of ``value`` as a hexadecimal string. ``code`` can be either an EDNS
|
2020-06-04 00:24:08 +00:00
|
|
|
option name (for example, ``NSID`` or ``ECS``) or an arbitrary
|
2019-03-31 12:49:47 +02:00
|
|
|
numeric value. ``+noednsopt`` clears the EDNS options to be sent.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]expire
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sends an EDNS Expire option.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]fail
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option indicates that ``named`` should try [or not try] the next server if a SERVFAIL is received. The default is
|
|
|
|
to not try the next server, which is the reverse of normal stub
|
2019-03-31 12:49:47 +02:00
|
|
|
resolver behavior.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]header-only
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sends a query with a DNS header without a question section. The
|
2019-03-31 12:49:47 +02:00
|
|
|
default is to add a question section. The query type and query name
|
|
|
|
are ignored when this is set.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]https[=value]
|
|
|
|
|
2022-01-20 15:40:37 +01:00
|
|
|
This option indicates whether to use DNS over HTTPS (DoH) when querying
|
2021-01-27 15:49:27 +01:00
|
|
|
name servers. When this option is in use, the port number defaults to 443.
|
|
|
|
The HTTP POST request mode is used when sending the query.
|
|
|
|
|
|
|
|
If ``value`` is specified, it will be used as the HTTP endpoint in the
|
|
|
|
query URI; the default is ``/dns-query``. So, for example, ``dig
|
|
|
|
@example.com +https`` will use the URI ``https://example.com/dns-query``.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]https-get[=value]
|
|
|
|
|
2021-01-27 15:49:27 +01:00
|
|
|
Similar to ``+https``, except that the HTTP GET request mode is used
|
|
|
|
when sending the query.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]https-post[=value]
|
|
|
|
|
2021-01-27 15:49:27 +01:00
|
|
|
Same as ``+https``.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]http-plain[=value]
|
|
|
|
|
2021-01-27 15:49:27 +01:00
|
|
|
Similar to ``+https``, except that HTTP queries will be sent over a
|
|
|
|
non-encrypted channel. When this option is in use, the port number
|
|
|
|
defaults to 80 and the HTTP request mode is POST.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]http-plain-get[=value]
|
|
|
|
|
2021-01-27 15:49:27 +01:00
|
|
|
Similar to ``+http-plain``, except that the HTTP request mode is GET.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]http-plain-post[=value]
|
|
|
|
|
2021-01-27 15:49:27 +01:00
|
|
|
Same as ``+http-plain``.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]identify
|
|
|
|
|
2021-01-27 15:49:27 +01:00
|
|
|
This option shows [or does not show] the IP address and port number that
|
|
|
|
supplied the answer, when the ``+short`` option is enabled. If short
|
|
|
|
form answers are requested, the default is not to show the source
|
|
|
|
address and port number of the server that provided the answer.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]idnin
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option processes [or does not process] IDN domain names on input. This requires
|
|
|
|
``IDN SUPPORT`` to have been enabled at compile time.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
The default is to process IDN input when standard output is a tty.
|
2020-06-04 00:24:08 +00:00
|
|
|
The IDN processing on input is disabled when ``dig`` output is redirected
|
2019-03-31 12:49:47 +02:00
|
|
|
to files, pipes, and other non-tty file descriptors.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]idnout
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option converts [or does not convert] puny code on output. This requires
|
|
|
|
``IDN SUPPORT`` to have been enabled at compile time.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
|
|
|
The default is to process puny code on output when standard output is
|
2020-06-04 00:24:08 +00:00
|
|
|
a tty. The puny code processing on output is disabled when ``dig`` output
|
2019-03-31 12:49:47 +02:00
|
|
|
is redirected to files, pipes, and other non-tty file descriptors.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]ignore
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option ignores [or does not ignore] truncation in UDP responses instead of retrying with TCP. By
|
2019-03-31 12:49:47 +02:00
|
|
|
default, TCP retries are performed.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]keepalive
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sends [or does not send] an EDNS Keepalive option.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]keepopen
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option keeps [or does not keep] the TCP socket open between queries, and reuses it rather than
|
2019-03-31 12:49:47 +02:00
|
|
|
creating a new TCP socket for each lookup. The default is
|
|
|
|
``+nokeepopen``.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]multiline
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option prints [or does not print] records, like the SOA records, in a verbose multi-line format
|
2019-03-31 12:49:47 +02:00
|
|
|
with human-readable comments. The default is to print each record on
|
2020-06-04 00:24:08 +00:00
|
|
|
a single line to facilitate machine parsing of the ``dig`` output.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +ndots=D
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets the number of dots (``D``) that must appear in ``name`` for
|
2019-03-31 12:49:47 +02:00
|
|
|
it to be considered absolute. The default value is that defined using
|
2020-06-04 00:24:08 +00:00
|
|
|
the ``ndots`` statement in ``/etc/resolv.conf``, or 1 if no ``ndots``
|
2019-03-31 12:49:47 +02:00
|
|
|
statement is present. Names with fewer dots are interpreted as
|
2020-06-04 00:24:08 +00:00
|
|
|
relative names, and are searched for in the domains listed in the
|
2019-03-31 12:49:47 +02:00
|
|
|
``search`` or ``domain`` directive in ``/etc/resolv.conf`` if
|
|
|
|
``+search`` is set.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]nsid
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
When enabled, this option includes an EDNS name server ID request when sending a query.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]nssearch
|
|
|
|
|
2019-03-31 12:49:47 +02:00
|
|
|
When this option is set, ``dig`` attempts to find the authoritative
|
2020-06-04 00:24:08 +00:00
|
|
|
name servers for the zone containing the name being looked up, and
|
2019-03-31 12:49:47 +02:00
|
|
|
display the SOA record that each name server has for the zone.
|
2020-06-04 00:24:08 +00:00
|
|
|
Addresses of servers that did not respond are also printed.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]onesoa
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
When enabled, this option prints only one (starting) SOA record when performing an AXFR. The
|
2019-03-31 12:49:47 +02:00
|
|
|
default is to print both the starting and ending SOA records.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]opcode=value
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
When enabled, this option sets (restores) the DNS message opcode to the specified value. The
|
2019-03-31 12:49:47 +02:00
|
|
|
default value is QUERY (0).
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +padding=value
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option pads the size of the query packet using the EDNS Padding option to
|
|
|
|
blocks of ``value`` bytes. For example, ``+padding=32`` causes a
|
2019-03-31 12:49:47 +02:00
|
|
|
48-byte query to be padded to 64 bytes. The default block size is 0,
|
2020-06-04 00:24:08 +00:00
|
|
|
which disables padding; the maximum is 512. Values are ordinarily
|
2019-03-31 12:49:47 +02:00
|
|
|
expected to be powers of two, such as 128; however, this is not
|
|
|
|
mandatory. Responses to padded queries may also be padded, but only
|
|
|
|
if the query uses TCP or DNS COOKIE.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +qid=value
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option specifies the query ID to use when sending queries.
|
2020-05-08 12:39:16 -07:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]qr
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles the display of the query message as it is sent. By default, the query
|
2019-03-31 12:49:47 +02:00
|
|
|
is not printed.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]question
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles the display of the question section of a query when an answer is
|
|
|
|
returned. The default is to print the question section as a comment.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]raflag
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets [or does not set] the RA (Recursion Available) bit in the query. The
|
|
|
|
default is ``+noraflag``. This bit is ignored by the server for
|
2019-03-31 12:49:47 +02:00
|
|
|
QUERY.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]rdflag
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option is a synonym for ``+[no]recurse``.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]recurse
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles the setting of the RD (recursion desired) bit in the query.
|
2019-03-31 12:49:47 +02:00
|
|
|
This bit is set by default, which means ``dig`` normally sends
|
|
|
|
recursive queries. Recursion is automatically disabled when the
|
2020-06-04 00:24:08 +00:00
|
|
|
``+nssearch`` or ``+trace`` query option is used.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +retry=T
|
|
|
|
|
2021-02-16 13:23:14 -03:00
|
|
|
This option sets the number of times to retry UDP and TCP queries to server to ``T``
|
|
|
|
instead of the default, 2. Unlike ``+tries``, this does not include
|
2019-03-31 12:49:47 +02:00
|
|
|
the initial query.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]rrcomments
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles the display of per-record comments in the output (for example,
|
2019-03-31 12:49:47 +02:00
|
|
|
human-readable key information about DNSKEY records). The default is
|
|
|
|
not to print record comments unless multiline mode is active.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]search
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option uses [or does not use] the search list defined by the searchlist or domain
|
|
|
|
directive in ``resolv.conf``, if any. The search list is not used by
|
2019-03-31 12:49:47 +02:00
|
|
|
default.
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
``ndots`` from ``resolv.conf`` (default 1), which may be overridden by
|
|
|
|
``+ndots``, determines whether the name is treated as relative
|
|
|
|
and hence whether a search is eventually performed.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]short
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles whether a terse answer is provided. The default is to print the answer in a verbose
|
|
|
|
form. This option always has a global effect; it cannot be set globally and
|
2019-03-31 12:49:47 +02:00
|
|
|
then overridden on a per-lookup basis.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]showbadcookie
|
|
|
|
|
2020-12-01 15:10:32 +11:00
|
|
|
This option toggles whether to show the message containing the
|
|
|
|
BADCOOKIE rcode before retrying the request or not. The default
|
|
|
|
is to not show the messages.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]showsearch
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option performs [or does not perform] a search showing intermediate results.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]sigchase
|
|
|
|
|
2019-03-31 12:49:47 +02:00
|
|
|
This feature is now obsolete and has been removed; use ``delv``
|
|
|
|
instead.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +split=W
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option splits long hex- or base64-formatted fields in resource records into
|
2019-03-31 12:49:47 +02:00
|
|
|
chunks of ``W`` characters (where ``W`` is rounded up to the nearest
|
|
|
|
multiple of 4). ``+nosplit`` or ``+split=0`` causes fields not to be
|
|
|
|
split at all. The default is 56 characters, or 44 characters when
|
|
|
|
multiline mode is active.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]stats
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles the printing of statistics: when the query was made, the size of the
|
|
|
|
reply, etc. The default behavior is to print the query statistics as a
|
2019-03-31 12:49:47 +02:00
|
|
|
comment after each lookup.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]subnet=addr[/prefix-length]
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sends [or does not send] an EDNS CLIENT-SUBNET option with the specified IP
|
2019-03-31 12:49:47 +02:00
|
|
|
address or network prefix.
|
|
|
|
|
|
|
|
``dig +subnet=0.0.0.0/0``, or simply ``dig +subnet=0`` for short,
|
|
|
|
sends an EDNS CLIENT-SUBNET option with an empty address and a source
|
|
|
|
prefix-length of zero, which signals a resolver that the client's
|
|
|
|
address information must *not* be used when resolving this query.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]tcflag
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets [or does not set] the TC (TrunCation) bit in the query. The default is
|
|
|
|
``+notcflag``. This bit is ignored by the server for QUERY.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]tcp
|
|
|
|
|
2020-07-22 08:59:42 +02:00
|
|
|
This option indicates whether to use TCP when querying name servers.
|
|
|
|
The default behavior is to use UDP unless a type ``any`` or ``ixfr=N``
|
|
|
|
query is requested, in which case the default is TCP. AXFR queries
|
|
|
|
always use TCP.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +timeout=T
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets the timeout for a query to ``T`` seconds. The default timeout is
|
|
|
|
5 seconds. An attempt to set ``T`` to less than 1 is silently set to 1.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]tls
|
|
|
|
|
2022-01-20 15:40:37 +01:00
|
|
|
This option indicates whether to use DNS over TLS (DoT) when querying
|
2021-01-27 15:49:27 +01:00
|
|
|
name servers. When this option is in use, the port number defaults
|
|
|
|
to 853.
|
2020-07-22 08:59:42 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]topdown
|
|
|
|
|
2019-03-31 12:49:47 +02:00
|
|
|
This feature is related to ``dig +sigchase``, which is obsolete and
|
|
|
|
has been removed. Use ``delv`` instead.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]trace
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option toggles tracing of the delegation path from the root name servers for
|
2019-03-31 12:49:47 +02:00
|
|
|
the name being looked up. Tracing is disabled by default. When
|
|
|
|
tracing is enabled, ``dig`` makes iterative queries to resolve the
|
2020-06-04 00:24:08 +00:00
|
|
|
name being looked up. It follows referrals from the root servers,
|
2019-03-31 12:49:47 +02:00
|
|
|
showing the answer from each server that was used to resolve the
|
|
|
|
lookup.
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
If ``@server`` is also specified, it affects only the initial query for
|
2019-03-31 12:49:47 +02:00
|
|
|
the root zone name servers.
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
``+dnssec`` is also set when ``+trace`` is set, to better emulate the
|
|
|
|
default queries from a name server.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +tries=T
|
|
|
|
|
2021-02-16 13:23:14 -03:00
|
|
|
This option sets the number of times to try UDP and TCP queries to server to ``T``
|
2019-03-31 12:49:47 +02:00
|
|
|
instead of the default, 3. If ``T`` is less than or equal to zero,
|
|
|
|
the number of tries is silently rounded up to 1.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +trusted-key=####
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option formerly specified trusted keys for use with ``dig +sigchase``. This
|
2019-03-31 12:49:47 +02:00
|
|
|
feature is now obsolete and has been removed; use ``delv`` instead.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]ttlid
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option displays [or does not display] the TTL when printing the record.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]ttlunits
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option displays [or does not display] the TTL in friendly human-readable time
|
|
|
|
units of ``s``, ``m``, ``h``, ``d``, and ``w``, representing seconds, minutes,
|
|
|
|
hours, days, and weeks. This implies ``+ttlid``.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]unknownformat
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option prints all RDATA in unknown RR type presentation format (:rfc:`3597`).
|
2019-03-31 12:49:47 +02:00
|
|
|
The default is to print RDATA for known types in the type's
|
|
|
|
presentation format.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]vc
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option uses [or does not use] TCP when querying name servers. This alternate
|
2019-03-31 12:49:47 +02:00
|
|
|
syntax to ``+[no]tcp`` is provided for backwards compatibility. The
|
2020-06-04 00:24:08 +00:00
|
|
|
``vc`` stands for "virtual circuit."
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]yaml
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
When enabled, this option prints the responses (and, if ``+qr`` is in use, also the
|
2019-03-31 12:49:47 +02:00
|
|
|
outgoing queries) in a detailed YAML format.
|
|
|
|
|
2022-03-02 15:12:17 +01:00
|
|
|
.. option:: +[no]zflag
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
This option sets [or does not set] the last unassigned DNS header flag in a DNS query.
|
2019-03-31 12:49:47 +02:00
|
|
|
This flag is off by default.
|
|
|
|
|
|
|
|
Multiple Queries
|
|
|
|
~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The BIND 9 implementation of ``dig`` supports specifying multiple
|
2022-03-02 16:54:31 +01:00
|
|
|
queries on the command line (in addition to supporting the :option:`-f` batch
|
2019-03-31 12:49:47 +02:00
|
|
|
file option). Each of those queries can be supplied with its own set of
|
2020-06-04 00:24:08 +00:00
|
|
|
flags, options, and query options.
|
2019-03-31 12:49:47 +02:00
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
In this case, each ``query`` argument represents an individual query in
|
2019-03-31 12:49:47 +02:00
|
|
|
the command-line syntax described above. Each consists of any of the
|
|
|
|
standard options and flags, the name to be looked up, an optional query
|
2020-06-04 00:24:08 +00:00
|
|
|
type and class, and any query options that should be applied to that
|
2019-03-31 12:49:47 +02:00
|
|
|
query.
|
|
|
|
|
|
|
|
A global set of query options, which should be applied to all queries,
|
|
|
|
can also be supplied. These global query options must precede the first
|
|
|
|
tuple of name, class, type, options, flags, and query options supplied
|
|
|
|
on the command line. Any global query options (except ``+[no]cmd`` and
|
|
|
|
``+[no]short`` options) can be overridden by a query-specific set of
|
|
|
|
query options. For example:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
|
|
|
|
|
2020-06-04 00:24:08 +00:00
|
|
|
shows how ``dig`` can be used from the command line to make three
|
|
|
|
lookups: an ANY query for ``www.isc.org``, a reverse lookup of 127.0.0.1,
|
2019-03-31 12:49:47 +02:00
|
|
|
and a query for the NS records of ``isc.org``. A global query option of
|
|
|
|
``+qr`` is applied, so that ``dig`` shows the initial query it made for
|
|
|
|
each lookup. The final query has a local query option of ``+noqr`` which
|
2020-06-04 00:24:08 +00:00
|
|
|
means that ``dig`` does not print the initial query when it looks up the
|
2019-03-31 12:49:47 +02:00
|
|
|
NS records for ``isc.org``.
|
|
|
|
|
|
|
|
IDN Support
|
|
|
|
~~~~~~~~~~~
|
|
|
|
|
|
|
|
If ``dig`` has been built with IDN (internationalized domain name)
|
|
|
|
support, it can accept and display non-ASCII domain names. ``dig``
|
2020-06-04 00:24:08 +00:00
|
|
|
appropriately converts character encoding of a domain name before sending
|
|
|
|
a request to a DNS server or displaying a reply from the server.
|
|
|
|
To turn off IDN support, use the parameters
|
|
|
|
``+noidnin`` and ``+noidnout``, or define the ``IDN_DISABLE`` environment
|
2019-03-31 12:49:47 +02:00
|
|
|
variable.
|
|
|
|
|
2019-11-18 22:19:21 +01:00
|
|
|
Return Codes
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
|
|
``dig`` return codes are:
|
|
|
|
|
|
|
|
``0``
|
|
|
|
DNS response received, including NXDOMAIN status
|
|
|
|
|
|
|
|
``1``
|
|
|
|
Usage error
|
|
|
|
|
|
|
|
``8``
|
|
|
|
Couldn't open batch file
|
|
|
|
|
|
|
|
``9``
|
|
|
|
No reply from server
|
|
|
|
|
|
|
|
``10``
|
|
|
|
Internal error
|
|
|
|
|
2019-03-31 12:49:47 +02:00
|
|
|
Files
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
``/etc/resolv.conf``
|
|
|
|
|
|
|
|
``${HOME}/.digrc``
|
|
|
|
|
|
|
|
See Also
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
:manpage:`delv(1)`, :manpage:`host(1)`, :manpage:`named(8)`, :manpage:`dnssec-keygen(8)`, :rfc:`1035`.
|
|
|
|
|
|
|
|
Bugs
|
|
|
|
~~~~
|
|
|
|
|
|
|
|
There are probably too many query options.
|