Terminal GuideTerminal Guide

dog

Modern CLI
macOSLinux
Rust

User-friendly DNS lookup tool (dig alternative).

Official Website

Features

Color OutputJSON OutputDoH/DoT SupportIntuitive
Replaces
dig

Installation

Homebrew
brew install dog
Pacman (Arch)
pacman -S dog
Cargo (Rust)
cargo install dog

Why 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 dog

Linux

Linux Installation
# Using Cargo
cargo install dog

# On Arch Linux
pacman -S dog

From 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 --version

Verify Installation

Verification
# Check version
dog --version

# Get help
dog --help

# Quick test
dog google.com

Basic 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.com

Multiple 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 CNAME

Output 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

OptionDescriptionExample
-t, --typeRecord type (A, AAAA, MX, NS, TXT, etc.)dog -t MX google.com
-n, --nameserverUse custom nameserverdog -n 8.8.8.8 google.com
--jsonOutput as JSONdog --json google.com
--httpsUse DNS over HTTPS (DoH)dog --https google.com
--tlsUse DNS over TLS (DoT)dog --tls google.com
-C, --colorForce color outputdog --color google.com
--no-colorDisable color outputdog --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.com

Using 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.com

Secure 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.com

JSON 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.14

Advanced 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"
done

DNS 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
done

Tips 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 records

Privacy 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 nameserver

dog vs dig

Featuredigdog
Output ReadabilityTechnical/verboseColorful/intuitive
Learning CurveSteepEasy
DoH/DoT SupportNoYes
JSON OutputNoNative support
InstallationUsually built-inSeparate install
Advanced OptionsExtensiveEssential ones

Tips

  • Use --https or --tls for secure DNS queries
  • Export results as JSON for automation and integration with other tools
  • Create aliases like alias dig=dog to 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
Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More