dig command builder
Say what to look up, where to ask and how, and get one copy-pasteable dig command with every token explained, the combinations the manual calls redundant or contradictory flagged, and a summary of what the query will carry: transport, port, RD, DO, CD, EDNS and cookie. The inverse of the dig output explainer. Runs nothing; built in your browser from the BIND 9 manual and the DNS RFCs.
AğFill in what you know; everything else keeps dig's default and is not written. The command updates as you type. Nothing is run here.
A is dig's default type and IN its default class, so neither is written. With -x, dig derives the PTR name itself and the name, type and class fields are not used. ANY, AXFR and IXFR are query types dig accepts in the type field.
dig's default: UDP to port 53, retrying over TCP when the answer comes back truncated (unless +ignore). Type ANY and ixfr=N default to TCP, and AXFR always uses TCP.
Only a key file is offered. dig also has -y, which takes the shared secret on the command line; the manual says to use -k instead, because the secret would show in ps output and in the shell's history.
dig @192.0.2.53 example.com MX +dnssec +multiline
Written for a POSIX shell (tokens that need it are single-quoted). In Windows cmd.exe, quote with double quotes instead.
What the query will carry
- Question
- example.com MX IN
- Asked
- the server named with @
- Transport
- UDP, port 53 (retries over TCP if truncated)
- RD, recursion desired
- yes
- DO, DNSSEC OK
- yes
- CD, checking disabled
- no
- AD, authentic data
- yes set by dig by default
- EDNS OPT record
- yes advertising dig's default size, 1232 bytes in BIND 9.18 and later
- DNS COOKIE option
- yes
- Signed (TSIG)
- no
Derived from the manual's stated defaults and interactions, not from running dig: RD set by default, cleared by +norecurse, +trace and +nssearch; DO set by +dnssec or +trace; EDNS version 0 by default; the cookie on by default and off with +nocookie or +noedns; type ANY and ixfr=N over TCP by default, AXFR always.
digThe BIND 9 DNS lookup utility.@192.0.2.53@server: ask this name server instead of the ones in /etc/resolv.conf. A host name is resolved first; an IPv4 or IPv6 address is used as is.example.comThe owner name to look up.MXThe record type (dig's default, A, is omitted).+dnssec+dnssec: set the DNSSEC OK (DO) bit in the OPT record, asking for the RRSIG and other DNSSEC records.+multiline+multiline: print records such as SOA and DNSKEY over several lines with comments.Built entirely in your browser from the intent above. Nothing is resolved, sent or stored.
Kaynaklar
- BIND 9 Administrator Reference Manual, Manual Pages: dig - DNS lookup utility (latest, 9.21)
- BIND 9 source, bin/dig/dig.c (isc-projects/bind9 on GitHub, main branch)
- RFC 1035: Domain Names - Implementation and Specification
- RFC 3596: DNS Extensions to Support IP Version 6
- RFC 6891: Extension Mechanisms for DNS (EDNS(0))
- RFC 3225: Indicating Resolver Support of DNSSEC
- RFC 4034: Resource Records for the DNS Security Extensions
- RFC 4035: Protocol Modifications for the DNS Security Extensions
- RFC 5936: DNS Zone Transfer Protocol (AXFR)
- RFC 1995: Incremental Zone Transfer in DNS
- RFC 8482: Providing Minimal-Sized Responses to DNS Queries That Have QTYPE=ANY
- RFC 7858: Specification for DNS over Transport Layer Security (TLS)
- RFC 8484: DNS Queries over HTTPS (DoH)
- RFC 5001: DNS Name Server Identifier (NSID) Option
- RFC 7871: Client Subnet in DNS Queries
- RFC 7873: Domain Name System (DNS) Cookies
- IANA: Domain Name System (DNS) Parameters, Resource Record (RR) TYPEs and DNS EDNS0 Option Codes
- ISC, BIND 9 9.20.29 documentation, Manual Pages: dig - DNS lookup utility (stable)
- BIND 9 source at tag v9.20.29, bin/dig/dighost.h
- ISC, BIND 9.18.0 CHANGES
- BIND 9 source at tag v9.16.50, bin/dig/include/dig/dig.h
- DNS Flag Day 2020
- RFC 5737: IPv4 Address Blocks Reserved for Documentation
- RFC 3849: IPv6 Address Prefix Reserved for Documentation