What it is¶
dog is a command-line DNS client written in Rust: a more approachable alternative to dig, with colorized aligned output by default, JSON output for scripting, and built-in support for DNS-over-TLS and DNS-over-HTTPS — none of which dig does natively.
Installation¶
# via cargo (works anywhere Rust is installed)
cargo install dog
# Arch
sudo pacman -S dog
# macOS
brew install dog
Basic usage¶
dog example.com # A record, colorized table output
dog example.com MX # specific record type
dog example.com AAAA A MX # multiple types in one query
dog example.com @1.1.1.1 # query a specific nameserver
Note the server goes at the end as @server, same syntax family as dig but position isn't fixed the same way — either order works.
Encrypted DNS transport¶
This is dog's standout feature over classic dig:
dog example.com --tls @1.1.1.1 # DNS-over-TLS
dog example.com --https @https://cloudflare-dns.com/dns-query # DNS-over-HTTPS
Output formats¶
dog example.com --json # machine-readable, for scripting/jq pipelines
dog example.com --short # just the answer, like dig +short
Cheat sheet¶
dog example.com # basic lookup, pretty output
dog example.com MX @8.8.8.8 # specific type against a specific server
dog example.com --tls @1.1.1.1 # DNS-over-TLS
dog example.com --json | jq . # scriptable output