dog
User-friendly DNS lookup tool (dig alternative).
Official WebsiteFeatures
Color OutputJSON OutputDoH/DoT SupportIntuitive
Replaces
digInstallation
Homebrew
brew install dogPacman (Arch)
pacman -S dogCargo (Rust)
cargo install dogWhy Use dog?
dog is a user-friendly DNS lookup tool designed as a modern alternative to dig. It provides colorful, easy-to-read output while supporting advanced features like DoH (DNS over HTTPS) and DoT (DNS over TLS).
Intuitive Output
Beautiful, colorized output that's easy to read compared to dig's technical format.
Modern Protocols
Support for DoH and DoT for secure DNS queries with privacy protection.
JSON Output
Export DNS results as JSON for scripting and integration with other tools.
Flexible Configuration
Custom nameservers, record types, and query options easy to specify.
Installation
macOS
macOS Installation
# Using Homebrew
brew install dogLinux
Linux Installation
# Using Cargo
cargo install dog
# On Arch Linux
pacman -S dogFrom Source
Build from Source
# Clone and build from GitHub
git clone https://github.com/ogham/dog.git
cd dog
cargo build --release
./target/release/dog --versionVerify Installation
Verification
# Check version
dog --version
# Get help
dog --help
# Quick test
dog google.comBasic Usage
Simple DNS Lookups
Basic Queries
# Look up A record (default)
dog google.com
# Query MX records
dog --type MX google.com
# Look up AAAA (IPv6)
dog --type AAAA google.com
# Query NS records
dog --type NS google.com
# Check CNAME
dog --type CNAME blog.example.comMultiple Queries
Multiple Lookups
# Query multiple domains
dog google.com github.com cloudflare.com
# Look up multiple record types
dog --type A,MX,TXT example.com
# Check different record types
dog example.com --type NS
dog example.com --type SOA
dog example.com --type CNAMEOutput Example
google.com
─ A
142.251.41.14
TTL: 299
142.251.41.46
TTL: 299
Color-coded output makes DNS records easy to parse visually.
Common Options
| Option | Description | Example |
|---|---|---|
-t, --type | Record type (A, AAAA, MX, NS, TXT, etc.) | dog -t MX google.com |
-n, --nameserver | Use custom nameserver | dog -n 8.8.8.8 google.com |
--json | Output as JSON | dog --json google.com |
--https | Use DNS over HTTPS (DoH) | dog --https google.com |
--tls | Use DNS over TLS (DoT) | dog --tls google.com |
-C, --color | Force color output | dog --color google.com |
--no-color | Disable color output | dog --no-color google.com |
Practical Examples
Common DNS Queries
Record Type Queries
# Email server information
dog -t MX example.com
# Authoritative nameservers
dog -t NS example.com
# Start of Authority record
dog -t SOA example.com
# Text records (SPF, DKIM, etc.)
dog -t TXT example.com
# CNAME aliases
dog -t CNAME mail.example.com
# All records
dog -t ANY example.comUsing Different DNS Providers
Custom Nameservers
# Google's DNS
dog -n 8.8.8.8 example.com
# Cloudflare DNS
dog -n 1.1.1.1 example.com
# OpenDNS
dog -n 208.67.222.123 example.com
# Quad9 DNS
dog -n 9.9.9.9 example.com
# Multiple nameservers
dog -n 8.8.8.8 -n 1.1.1.1 example.comSecure DNS Queries
Secure Protocols
# DNS over HTTPS (DoH)
dog --https example.com
# DNS over TLS (DoT)
dog --tls example.com
# DoH with custom server
dog --https -n 1.1.1.1 example.com
# DoT with Quad9
dog --tls -n 9.9.9.9 example.comJSON Output for Scripts
JSON Integration
# Export as JSON
dog --json google.com > dns_result.json
# Extract IP with jq
dog --json google.com | jq '.answers[].data'
# Process multiple domains
for domain in google.com github.com cloudflare.com; do
dog --json "$domain" | jq '.answers[].data'
done
# Check DNS propagation
dog --json --type MX example.com | jq '.answers'Troubleshooting DNS
DNS Diagnostics
# Check all records for domain
dog example.com -t A
dog example.com -t MX
dog example.com -t NS
dog example.com -t TXT
# Compare results from different servers
dog -n 8.8.8.8 example.com
dog -n 1.1.1.1 example.com
# Verify DNS propagation
dog -n ns1.provider.com example.com
# Check reverse DNS
dog -t PTR 142.251.41.14Advanced Usage
Shell Aliases
Useful Aliases
# ~/.bashrc or ~/.zshrc
# Quick lookups
alias dns='dog'
alias dnsm='dog -t MX'
alias dnsns='dog -t NS'
alias dnstxt='dog -t TXT'
# Check with specific servers
alias dns-google='dog -n 8.8.8.8'
alias dns-cloudflare='dog -n 1.1.1.1'
# Secure queries
alias dns-https='dog --https'
alias dns-tls='dog --tls'
# JSON export
alias dns-json='dog --json'Batch DNS Checking
Batch Operations
# Check multiple domains
cat > domains.txt <<'EOF'
google.com
github.com
cloudflare.com
EOF
# Query all domains
while read domain; do
echo "=== $domain ==="
dog "$domain"
done < domains.txt
# Export all to JSON
for domain in $(cat domains.txt); do
dog --json "$domain" > "$domain.json"
doneDNS Monitoring
Monitoring DNS
# Monitor DNS changes
watch 'dog example.com'
# Compare different nameservers
diff <(dog -n 8.8.8.8 example.com) <(dog -n 1.1.1.1 example.com)
# Check DNS propagation over time
for i in {1..5}; do
echo "Check $i:"
dog -n 8.8.8.8 example.com | grep -E '^s+[0-9]+.'
sleep 30
doneTips and Best Practices
Record Types Reference
DNS Record Types
# Common record types:
A - IPv4 address (most common)
AAAA - IPv6 address
MX - Mail server
NS - Nameserver
CNAME - Canonical name (alias)
TXT - Text records (SPF, DKIM, verification)
SOA - Start of Authority
PTR - Pointer (reverse DNS)
SRV - Service
CAA - Certificate Authority Authorization
TLSA - DANE/TLS authentication
# Example lookups
dog -t A example.com # IPv4
dog -t AAAA example.com # IPv6
dog -t MX example.com # Email
dog -t TXT example.com # Text recordsPrivacy and Security
Privacy Options
# Use DoH for privacy
dog --https example.com
# Use DoT for encrypted queries
dog --tls example.com
# Use privacy-focused DNS providers
dog --https -n 1.1.1.1 example.com # Cloudflare
dog --https -n 9.9.9.9 example.com # Quad9
dog --https -n 64.6.64.6 example.com # Verisign
# Check what your ISP sees
dog example.com # Uses system default nameserverdog vs dig
| Feature | dig | dog |
|---|---|---|
| Output Readability | Technical/verbose | Colorful/intuitive |
| Learning Curve | Steep | Easy |
| DoH/DoT Support | No | Yes |
| JSON Output | No | Native support |
| Installation | Usually built-in | Separate install |
| Advanced Options | Extensive | Essential ones |
Tips
- •Use
--httpsor--tlsfor secure DNS queries - •Export results as JSON for automation and integration with other tools
- •Create aliases like
alias dig=dogto replace dig in your workflow - •MX queries help verify email server configuration
- •Check TXT records to verify SPF, DKIM, and domain verification
- •Query different nameservers to check DNS propagation across the internet