dog — A Command-Line DNS Client for Humans
dog is a modern DNS lookup CLI written in Rust that prints results in color, supports DNS-over-TLS and DNS-over-HTTPS, and speaks JSON for scripting.
What it is
dog is a modern DNS lookup command-line tool written in Rust. It prints results in color, supports DNS-over-TLS (DoT) and DNS-over-HTTPS (DoH), and outputs JSON for scripting. It is designed as a human-friendly alternative to the traditional dig command.
dog targets developers, network engineers, and system administrators who perform DNS lookups regularly. It provides the same information as dig but with cleaner output, better defaults, and modern protocol support.
How it saves time or tokens
dig's output is verbose and hard to parse visually. dog's colorized output makes it easy to spot the information you need at a glance. JSON output (--json) integrates directly with jq and other scripting tools without text parsing. DoH and DoT support means you can test secure DNS resolution without configuring system-level DNS settings.
How to use
- Install dog:
brew install dog # macOS
cargo install dog # From source
- Basic DNS lookups:
dog example.com # A record lookup
dog MX example.com # MX records
dog AAAA example.com # IPv6 records
dog TXT example.com # TXT records
dog NS example.com # Name servers
- Advanced features:
# DNS-over-HTTPS via Cloudflare
dog A example.com --https @https://cloudflare-dns.com/dns-query
# DNS-over-TLS via Google
dog A example.com --tls @dns.google
# JSON output for scripting
dog A example.com --json | jq '.responses[].answers[].address'
# Specify a custom DNS server
dog A example.com @8.8.8.8
Example
# Check if a domain resolves correctly across different DNS providers
dog A mysite.com @8.8.8.8 # Google DNS
dog A mysite.com @1.1.1.1 # Cloudflare DNS
dog A mysite.com @9.9.9.9 # Quad9 DNS
# Verify DMARC and SPF records
dog TXT _dmarc.example.com
dog TXT example.com | grep spf
# Check CNAME chains
dog CNAME www.example.com
Related on TokRepo
- AI Tools for DevOps — Infrastructure and networking tools
- Featured Workflows — Top-rated CLI tools
This tool integrates with standard development workflows and requires minimal configuration to get started. It is available as open-source software with documentation and community support through the official repository. The project follows semantic versioning for stable releases.
For teams evaluating this tool, the key advantage is reducing manual work in repetitive tasks. The automation provided by the built-in features means less custom code to maintain and fewer integration points to manage. This translates directly to lower maintenance costs and faster iteration cycles.
Common pitfalls
- dog is no longer actively maintained (last release was 2021); the tool works well for basic DNS lookups but may not support the latest DNS record types.
- Some Linux distributions do not have dog in their package repositories; install from source via cargo or use prebuilt binaries.
- JSON output format differs from dig's output; scripts written for dig output will need adaptation.
Frequently Asked Questions
dog provides colorized output, cleaner formatting, DNS-over-HTTPS and DNS-over-TLS support, and JSON output. dig is more comprehensive and handles edge cases better, but dog is faster to read for common lookups.
Yes. Use the --https flag with a DoH resolver URL. Cloudflare (https://cloudflare-dns.com/dns-query) and Google (https://dns.google/dns-query) are common DoH endpoints.
Yes. The --json flag outputs structured JSON that can be parsed with jq or other JSON tools. The --short flag outputs only answer values for simpler scripting.
dog's development has slowed since 2021, but the existing version works reliably for standard DNS lookups. For actively maintained alternatives, consider doggo (a Go-based DNS client with similar features).
dog supports A, AAAA, MX, TXT, NS, CNAME, SOA, SRV, PTR, CAA, and other standard DNS record types. Use the record type as the first argument before the domain name.
Citations (3)
- dog GitHub— dog is a modern DNS client written in Rust with color and JSON output
- RFC 8484 (DoH)— DNS-over-HTTPS and DNS-over-TLS protocol specifications
- dog README— dog supports A, AAAA, MX, TXT, NS, CNAME, and other record types
Related on TokRepo
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.