ScriptsApr 15, 2026·2 min read

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.

TL;DR
dog is a modern DNS CLI with colorized output, DoT, DoH, and JSON support as a human-friendly dig replacement.
§01

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.

§02

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.

§03

How to use

  1. Install dog:
brew install dog          # macOS
cargo install dog         # From source
  1. 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
  1. 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
§04

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
§05

Related on TokRepo

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.

§06

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

How is dog different from dig?+

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.

Does dog support DNS-over-HTTPS?+

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.

Can I use dog in shell scripts?+

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.

Is dog still maintained?+

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).

What record types does dog support?+

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

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets