id = "dig" name = "dig" homepage = "https://bind9.readthedocs.io/en/latest/manpages.html#dig-dns-lookup-utility" description = "dig is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers returned." executables = ["dig"] [dotfiles] # dig(1), FILES: "/etc/resolv.conf" and "${HOME}/.digrc". The DESCRIPTION says # "It is possible to set per-user defaults for dig via ${HOME}/.digrc. This # file is read and any options in it are applied before the command line # arguments." Only the system file lives in /etc, so ~/.digrc is the whole of # dig's user configuration. paths = ["~/.digrc"] exclude = [] # Query options only. TSIG keys are passed with -k/-y on the command line and # live in a keyfile the user names, not in a fixed path dig owns. secret = [] # Read once per invocation, before the command line is applied. side_effect = false # No machine_lines: everything in .digrc is an output preference (+short, # +noall, +answer) that a user wants on every machine. [commands] format = 1 label = "DNS lookup" description = "Query DNS records with dig. Only common query and display options are covered; TSIG keys, batch mode and most +keyword options are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "help" kind = "help" revision = "dig -h (macOS)" evidence = """Usage: dig [@global-server] [domain] [q-type] [q-class] {q-opt} {global-d-opt} host [@local-server] {local-d-opt} [ host [@local-server] {local-d-opt} [...]] Where: domain is in the Domain Name System q-class is one of (in,hs,ch,...) [default: in] q-type is one of (a,any,mx,ns,soa,hinfo,axfr,txt,...) [default:a] (Use ixfr=version for type ixfr) q-opt is one of: -4 (use IPv4 query transport only) -6 (use IPv6 query transport only) -b address[#port] (bind to source address/port) -c class (specify query class) -f filename (batch mode) -i (use IP6.INT for IPv6 reverse lookups) -k keyfile (specify tsig key file) -m (enable memory usage debugging) -p port (specify port number) -q name (specify query name) -t type (specify query type) -u (display times in usec instead of msec) -x dot-notation (shortcut for reverse lookups) -y [hmac:]name:key (specify named base64 tsig key) d-opt is of the form +keyword[=value], where keyword is: +[no]aaonly (Set AA flag in query (+[no]aaflag)) +[no]additional (Control display of additional section) +[no]adflag (Set AD flag in query (default on)) +[no]all (Set or clear all display flags) +[no]answer (Control display of answer section) +[no]authority (Control display of authority section) +[no]besteffort (Try to parse even illegal messages) +bufsize=### (Set EDNS0 Max UDP packet size) +[no]cdflag (Set checking disabled flag in query) +[no]cl (Control display of class in records) +[no]cmd (Control display of command line) +[no]comments (Control display of comment lines) +[no]crypto (Control display of cryptographic fields in records) +[no]defname (Use search list (+[no]search)) +[no]dnssec (Request DNSSEC records) +domain=### (Set default domainname) +[no]edns[=###] (Set EDNS version) [0] +ednsflags=### (Set EDNS flag bits) +[no]ednsnegotiation (Set EDNS version negotiation) +ednsopt=###[:value] (Send specified EDNS option) +noednsopt (Clear list of +ednsopt options) +[no]expire (Request time to expire) +[no]fail (Don't try next server on SERVFAIL) +[no]identify (ID responders in short answers) +[no]idnout (convert IDN response) +[no]ignore (Don't revert to TCP for TC responses.) +[no]keepopen (Keep the TCP socket open between queries) +[no]multiline (Print records in an expanded format) +ndots=### (Set search NDOTS value) +[no]nsid (Request Name Server ID) +[no]nssearch (Search all authoritative nameservers) +[no]onesoa (AXFR prints only one soa record) +[no]opcode=### (Set the opcode of the request) +[no]qr (Print question before sending) +[no]question (Control display of question section) +[no]recurse (Recursive mode) +retry=### (Set number of UDP retries) [2] +[no]rrcomments (Control display of per-record comments) +[no]search (Set whether to use searchlist) +[no]short (Display nothing except short form of answer) +[no]showsearch (Search with intermediate results) +[no]split=## (Split hex/base64 fields into chunks) +[no]stats (Control display of statistics) +subnet=addr (Set edns-client-subnet option) +[no]tcp (TCP mode (+[no]vc)) +time=### (Set query timeout) [5] +[no]trace (Trace delegation down from root [+dnssec]) +tries=### (Set number of UDP attempts) [3] +[no]ttlid (Control display of ttls in records) +[no]vc (TCP mode (+[no]tcp)) global d-opts and servers (before host name) affect all queries. local d-opts and servers (after host name) affect only that lookup. -h (print help and exit) -v (print version and exit) """ [[commands.source]] id = "manual" kind = "manual" url = "https://bind9.readthedocs.io/en/latest/manpages.html" revision = "BIND 9 dig(1), 2026-10-27" evidence = """+short, +noshort +multiline, +nomultiline +tcp, +notcp +trace, +notrace """ [[commands.field]] id = "server" label = "Server (@host)" description = "Include the @, e.g. @1.1.1.1. Leave empty for the system resolver." type = "string" position = 0 sources = ["help"] [[commands.field]] id = "name" label = "Name" type = "string" position = 1 sources = ["help"] [[commands.field]] id = "type" label = "Record type" type = "string" position = 2 suggestions = [{ value = "A", label = "A" }, { value = "AAAA", label = "AAAA" }, { value = "MX", label = "MX" }, { value = "NS", label = "NS" }, { value = "TXT", label = "TXT" }, { value = "CNAME", label = "CNAME" }, { value = "SOA", label = "SOA" }, { value = "ANY", label = "ANY" }] sources = ["help"] [[commands.field]] id = "short" label = "Short answer" type = "boolean" option = ["+short"] sources = ["manual"] [[commands.field]] id = "trace" label = "Trace delegation from root" type = "boolean" option = ["+trace"] sources = ["manual"] [[commands.field]] id = "tcp" label = "Use TCP" type = "boolean" option = ["+tcp"] sources = ["manual"] [[commands.field]] id = "dnssec" label = "Request DNSSEC records" type = "boolean" option = ["+dnssec"] sources = ["help"] [[commands.field]] id = "multiline" label = "Multi-line records" type = "boolean" option = ["+multiline"] sources = ["manual"] [[commands.field]] id = "ipv4" label = "IPv4 only" type = "boolean" option = ["-4"] sources = ["help"] [[commands.field]] id = "ipv6" label = "IPv6 only" type = "boolean" option = ["-6"] sources = ["help"] [[commands.field]] id = "port" label = "Port" type = "integer" option = ["-p"] sources = ["help"] [[commands.field]] id = "query_class" label = "Query class" type = "string" option = ["-c"] suggestions = [{ value = "IN", label = "IN" }, { value = "CH", label = "CH" }, { value = "HS", label = "HS" }] sources = ["help"] [[commands.field]] id = "timeout" label = "Timeout (seconds)" type = "integer" option = ["+time"] value_style = "equals" sources = ["help"] [[commands.task]] id = "lookup" label = "Look up a record" fields = ["server", "name", "type"] required = ["name"] [[commands.task]] id = "short" label = "Short answer" set = { short = [true] } fields = ["server", "name", "type", "short"] required = ["name"] [[commands.task]] id = "trace" label = "Trace resolution" set = { trace = [true] } fields = ["name", "type", "trace"] required = ["name"] [[commands.group]] id = "basic" label = "Basic" fields = ["server", "name", "type", "short", "trace"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["port", "query_class", "timeout", "multiline", "dnssec", "ipv4", "ipv6", "tcp"]