dog is a command-line DNS client.
Dogs can look up!
dog is a command-line DNS client, like
It has colourful output, understands normal command-line argument syntax, supports the DNS-over-TLS and DNS-over-HTTPS protocols, and can emit JSON.
dog example.net Query a domain using default settings dog example.net MX ...looking up MX records instead dog example.net MX @188.8.131.52 ...using a specific nameserver instead dog example.net MX @184.108.40.206 -T ...using TCP rather than UDP dog -q example.net -t MX -n 220.127.116.11 -T As above, but using explicit arguments
<arguments> Human-readable host names, nameservers, types, or classes -q, --query=HOST Host name or domain name to query -t, --type=TYPE Type of the DNS record being queried (A, MX, NS...) -n, --nameserver=ADDR Address of the nameserver to send packets to --class=CLASS Network class of the DNS record being queried (IN, CH, HS)
--edns=SETTING Whether to OPT in to EDNS (disable, hide, show) --txid=NUMBER Set the transaction ID to a specific value -Z=TWEAKS Set uncommon protocol-level tweaks
-U, --udp Use the DNS protocol over UDP -T, --tcp Use the DNS protocol over TCP -S, --tls Use the DNS-over-TLS protocol -H, --https Use the DNS-over-HTTPS protocol
-1, --short Short mode: display nothing but the first result -J, --json Display the output as JSON --color, --colour=WHEN When to colourise the output (always, automatic, never) --seconds Do not format durations, display them as seconds --time Print how long the response took to arrive
To install dog, you can download a pre-compiled binary, or you can compile it from source. You may be able to install dog using your OS’s package manager, depending on your platform.
- For Arch Linux, install the
dog-dnspackage from the AUR.
- For Homebrew on macOS, install the
Binary downloads of dog are available from the releases section on GitHub for 64-bit Windows, macOS, and Linux targets. They contain the compiled executable, the manual page, and shell completions.
To build, download the source code and run:
$ cargo build $ cargo test
The just command runner can be used to run some helpful development commands, in a manner similar to
just --tasksto get an overview of what’s available.
If you are compiling a copy for yourself, be sure to run
cargo build --releaseor
just build-releaseto benefit from release-mode optimisations. Copy the resulting binary, which will be in the
target/releasedirectory, into a folder in your
/usr/local/binis usually a good choice.
To compile and install the manual pages, you will need pandoc. The
just mancommand will compile the Markdown into manual pages, which it will place in the
target/mandirectory. To use them, copy them into a directory that
/usr/local/share/manis usually a good choice.
dog has an integration test suite written as Specsheet check documents. If you have a copy installed, you can run:
Specsheet will test the compiled binary by making DNS requests over the network, checking that dog returns results and does not crash.
For documentation on how to use dog, see the website: https://dns.lookup.dog/
dog’s source code is licenced under the European Union Public Licence.