sdig IP-ADDRESS-OR-DOH-URL PORT QNAME QTYPE [OPTION]
sdig sends a DNS query to IP-ADDRESS-OR-DOH-URL on port PORT and displays the answer in a formatted way.
If the address starts with an h
, it is assumed to be a DoH endpoint, and PORT is ignored.
If qname and qtype are both - and tcp is used, multiple lines are read from stdin, where each line contains a qname and a type.
If the address is stdin
, a DNS packet is read from stdin instead of from the network, and PORT is ignored.
All input is literal and case sensitive.
Queries need option recurse to expect a resource record reply if the query target is not known to be the authoritative server for that record.
These options can be added to the commandline in any order.
sdig 192.0.2.1 53 example.com SOA opcode 4
sends a NOTIFY
.sdig 127.0.0.1 53 example.com AAAA recurse
sdig ::1 53 example.com A recurse
sdig https://dns.example.net/dns-query 443 example.com A dnssec recurse