MDIG(1)
๐ MDIG(1) โ BIND 9 bestie edition ๐
โจ NAME โจ
mdig โ DNS pipelined lookup utility. periodt. ๐
๐ฐ๏ธ SYNOPSIS ๐ฐ๏ธ
mdig <{@server>} [-f filename] [-h] [-v] [ [-4] | [-6] ] [-m] [-b
address] [-p port#] [-c class] [-t type] [-i] [-x addr] [plusopt...]
mdig {-h}
mdig [@server] {global-opt...} { {local-opt...} {query} ...}
๐ฌ DESCRIPTION ๐ฌ
Okay so bestie, mdig is literally the multiple/pipelined query version of dig <#std-iscman-dig>: instead of waiting for a response after sending each query, it begins by sending all queries. Responses are displayed in the order in which they are received, not in the order the corresponding queries were sent. chaotic? yes. iconic? also yes. ๐ฆ
mdig options are a subset of the dig <#std-iscman-dig> options, and are divided into "anywhere options," which can occur anywhere, "global options," which must occur before the query name (or they are ignored with a warning), and "local options," which apply to the next query on the command line. iykyk. โจ
The @server option is a mandatory global option. It is the name or IP address of the name server to query. (Unlike dig <#std-iscman-dig>, this value is not retrieved from /etc/resolv.conf.) It can be an IPv4 address in dotted-decimal notation, an IPv6 address in colon-delimited notation, or a hostname. When the supplied server argument is a hostname, mdig resolves that name before querying the name server. no cap, it does the lookup first. ๐
mdig 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. lots of little dials, bestie. ๐
Each query option is identified by a keyword preceded by a plus sign (+). Some keywords set or reset an option. These may be preceded by the string no to negate the meaning of that keyword. Other keywords assign values to options like the timeout interval. They have the form +keyword=value. copy that format exactly, fr fr. โญ
๐ ๏ธ ANYWHERE OPTIONS ๐ ๏ธ
-f filenameโ This option makesmdigoperate in batch mode by reading a list of lookup requests to process from the filefilename. The file contains a number of queries, one per line. Each entry in the file should be organized in the same way they would be presented as queries tomdigusing the command-line interface. one query per line, bestie. ๐-hโ This option causesmdigto print detailed help information, with the full list of options, and exit. helpful queen behavior. ๐ซถ-vโ This option causesmdigto print the version number and exit. version check, slay. ๐
๐ GLOBAL OPTIONS ๐
-4โ This option forcesmdigto only use IPv4 query transport. IPv4 only, no cap. ๐-6โ This option forcesmdigto only use IPv6 query transport. IPv6 only, periodt. ๐-b addressโ This option sets the source IP address of the query toaddress. This must be a valid address on one of the host's network interfaces or"0.0.0.0"or"::". An optional port may be specified by appending"#<port>". source address glow-up. โจ-mโ This option enables memory usage debugging. memory gossip, basically. ๐ง-p port#โ This option is used when a non-standard port number is to be queried.port#is the port number thatmdigsends its queries to, instead of the standard DNS port number53. This option is used to test a name server that has been configured to listen for queries on a non-standard port number. not the usual53, bestie. ๐ฅ
โจ The global query options are โจ
+additional,+noadditionalโ This option displays [or does not display] the additional section of a reply. The default is to display it. additional section: shown by default. ๐+all,+noallโ This option sets or clears all display flags. all the flags, one little switch. ๐+answer,+noanswerโ This option displays [or does not display] the answer section of a reply. The default is to display it. answer section: shown by default. ๐+authority,+noauthorityโ This option displays [or does not display] the authority section of a reply. The default is to display it. authority section: shown by default. ๐+besteffort,+nobesteffortโ This option attempts to display [or does not display] the contents of messages which are malformed. The default is to not display malformed answers. malformed answers stay hidden unless you ask. ๐+burstโ This option delays queries until the start of the next second. wait for the next second, then go. โณ+cl,+noclโ This option displays [or does not display] the CLASS when printing the record. CLASS visibility toggle. ๐ฆ+comments,+nocommentsโ This option toggles the display of comment lines in the output. The default is to print comments. comments on by default, bestie. ๐ฌ+continue,+nocontinueโ This option toggles continuation on errors (e.g. timeouts). keep going after errors? toggle it. ๐+crypto,+nocryptoโ This option toggles the display of cryptographic fields in DNSSEC records. The contents of these fields are unnecessary to debug most DNSSEC validation failures and removing them makes it easier to see the common failures. The default is to display the fields. When omitted, they are replaced by the string[omitted]; in the DNSKEY case, the key ID is displayed as the replacement, e.g.,[ key id = value ]. crypto fields: useful sometimes, noisy other times. ๐+multiline,+nomultilineโ This option toggles printing of records, like the SOA records, in a verbose multi-line format with human-readable comments. The default is to print each record on a single line, to facilitate machine parsing of themdigoutput. one-line default = machine-parseable vibes. ๐ค+question,+noquestionโ This option prints [or does not print] the question section of a query when an answer is returned. The default is to print the question section as a comment. question section defaults to a comment. ๐+rrcomments,+norrcommentsโ This option toggles the display of per-record comments in the output (for example, human-readable key information about DNSKEY records). The default is not to print record comments unless multiline mode is active. record comments only by default in multiline mode. ๐+short,+noshortโ This option provides [or does not provide] a terse answer. The default is to print the answer in a verbose form. short mode is a whole vibe, but verbose is the default. โจ+split=Wโ This option splits long hex- or base64-formatted fields in resource records into chunks ofWcharacters (whereWis rounded up to the nearest multiple of 4).+nosplitor+split=0causes fields not to be split. The default is56characters, or44characters when multiline mode is active. chunky fields, controlled byW. ๐ง+tcp,+notcpโ This option uses [or does not use] TCP when querying name servers. The default behavior is to use UDP. UDP is the default, bestie. ๐+ttlid,+nottlidโ This option displays [or does not display] the TTL when printing the record. TTL visibility toggle. ๐+ttlunits,+nottlunitsโ 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. friendly TTL units: seconds, minutes, hours, days, weeks. ๐+vc,+novcโ This option uses [or does not use] TCP when querying name servers. This alternate syntax to+tcpis provided for backwards compatibility. Thevcstands for"virtual circuit". old-school syntax, still valid. ๐
๐ LOCAL OPTIONS ๐
okay so these ones are the ones that actually shape your query, bestie โ not the whole run, just the one thing you're asking for. let's go ๐
-cclass โ sets the query class to class. it can be literally any valid query class that BIND 9 supports. default isIN, iykyk.-ttype โ sets the query type to type. again, any valid query type BIND 9 supports is fair game. default isA... unless you threw in-x, in which case it flips toPTRbecause that's a reverse lookup, obviously ๐ฆ-xaddr โ reverse lookups (mapping addresses โ names) get so much simpler with this. addr is either an IPv4 address in dotted-decimal notation, or a colon-delimited IPv6 address.mdiggoes and does the lookup for you on a query name like11.12.13.10.in-addr.arpaand sets the query type and class toPTRandINrespectively. no cap, it just handles it. and by default, IPv6 addresses get looked up using nibble format under theIP6.ARPAdomain. โจ
the local query options ๐ซถ
these are the + ones. yes there are a lot. yes you should read them all. periodt.
+aaflag,+noaaflagโ this is literally just a synonym for+aaonly,+noaaonly. same thing, different font ๐+aaonly,+noaaonlyโ this sets the aa flag in the query.+adflag,+noadflagโ this sets [or does not set] the AD (authentic data) bit in the query. what that does: it requests the server to tell you whether all of the answer and authority sections have been validated as secure, according to the security policy of the server. soAD=1means everything was validated as secure and the answer is not from an OPT-OUT range.AD=0means some part of the answer was insecure or not validated. ๐ this bit is set by default.+bufsize=Bโ sets the UDP message buffer size that gets advertised using EDNS0 to B bytes. max is65535, min is0. values outside that range get rounded up or down appropriately (it handles it, don't worry). any value other than zero causes an EDNS query to be sent. ๐ฅ+cdflag,+nocdflagโ sets [or does not set] the CD (checking disabled) bit in the query. this is you asking the server to not perform DNSSEC validation of responses. bold of you, but ok.+cookie=####,+nocookieโ sends [or does not send] a COOKIE EDNS option, with an optional value. replaying a COOKIE from a previous response lets the server identify a previous client (๐ hello again). default is+nocookie.+dnssec,+nodnssecโ requests that DNSSEC records be sent by setting the DNSSEC OK (DO) bit in the OPT record in the additional section of the query. say yes to DNSSEC bestie ๐+edns[=#],+noednsโ specifies [or does not specify] the EDNS version to query with. valid values are0to255. setting the EDNS version causes an EDNS query to be sent.+noednsclears the remembered EDNS version. EDNS is set to0by default.+ednsflags[=#],+noednsflagsโ sets the must-be-zero EDNS flag bits (Z bits) to whatever value you give. decimal, hex, and octal encodings are all accepted. setting a named flag (e.g.DO) is silently ignored. by default, no Z bits are set. ๐+ednsopt[=code[:value]],+noednsoptโ specifies [or does not specify] an EDNS option with code point code and an optional payload of value as a hexadecimal string.+noednsoptclears the EDNS options to be sent.+expire,+noexpireโ toggles sending of an EDNS Expire option.+nsid,+nonsidโ toggles inclusion of an EDNS name server ID request when sending a query.+recurse,+norecurseโ toggles the setting of the RD (recursion desired) bit in the query. this bit is set by default, which meansmdignormally sends recursive queries. ๐+retry=Tโ sets the number of times to retry UDP queries to server to T instead of the default,2. and heads up: unlike+tries, this does not include the initial query. don't get it twisted ๐+subnet=addr[/prefix-length],+nosubnetโ sends [or does not send] an EDNS Client Subnet option with the specified IP address or network prefix.
and then there's this specific little move:
mdig +subnet=0.0.0.0/0, or simplymdig +subnet=0โ this sends an EDNS client-subnet option with an empty address and a source prefix-length of zero, which signals to a resolver that the client's address information must not be used when resolving this query. stealth mode basically ๐ฅท
+timeout=Tโ sets the timeout for a query to T seconds. default timeout is5seconds for UDP transport and10for TCP. and if you try to set T to less than1, you get a query timeout of1second applied. them's the rules.+tries=Tโ sets the number of times to try UDP queries to server to T instead of the default,3. if T is less than or equal to zero, the number of tries is silently rounded up to1. silently. it's not gonna argue with you, it's just gonna do it. ๐+udptimeout=Tโ sets the timeout between UDP query retries to T.+unknownformat,+nounknownformatโ prints [or does not print] all RDATA in unknown RR-type presentation format (seeRFC 3597,https://datatracker.ietf.org/doc/html/rfc3597.html). the default is to print RDATA for known types in the type's presentation format. ๐ธ+yaml,+noyamlโ toggles printing of the responses in a detailed YAML format. for the girlies who like their output structured โจ+zflag,+nozflagโ sets [or does not set] the last unassigned DNS header flag in a DNS query. this flag is off by default. it's the mystery flag, it's giving main character energy that nobody's assigned yet ๐
๐ SEE ALSO ๐
๐ Author ๐
Internet Systems Consortium โ icons, honestly.
๐ซถ Copyright ๐ซถ
2026, Internet Systems Consortium
and that's the whole page bestie, you ate that ๐ this was MDIG(1) from BIND 9.20.30, dated 2026-10-12 โ go forth and query slayfully ๐ฆโญ
๐ฆ where this page comes from
- alpine 3.22: bind-doc 9.20.30-r0 ยท MPL-2.0
- alpine 3.23: bind-doc 9.20.30-r0 ยท MPL-2.0
- alpine 3.24: bind-doc 9.20.30-r0 ยท MPL-2.0
- nixos 26.05: bind 9.20.30
- nixpkgs unstable: bind 9.20.30
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms