Linux dig Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux dig Guide
Complete beginner-friendly guide to dig on Linux, covering Arch Linux, CachyOS, and other distributions including DNS queries, domain information, and network troubleshooting.
Table of Contents
dig Installation
Install dig
Arch/CachyOS:
# Install bind-tools
sudo pacman -S bind
Debian/Ubuntu:
sudo apt install dnsutils
Fedora:
sudo dnf install bind-utils
dig Basics
Query Domain
Basic usage:
# Query domain
dig example.com
# Shows DNS information
Short Output
Brief output:
# Short output
dig +short example.com
# Shows only IP address
DNS Queries
Query Type
Specific type:
# Query MX records
dig example.com MX
# Query AAAA records
dig example.com AAAA
# Query NS records
dig example.com NS
Custom DNS Server
Use server:
# Use specific DNS server
dig @8.8.8.8 example.com
# @ = DNS server
Query Types
Reverse DNS
PTR lookup:
# Reverse DNS lookup
dig -x 8.8.8.8
# -x = reverse lookup
Trace Query
Trace resolution:
# Trace DNS resolution
dig +trace example.com
# Shows full resolution path
Troubleshooting
dig Not Found
Check installation:
# Check dig
which dig
# Install if missing
sudo pacman -S bind
Summary
This guide covered dig usage, DNS queries, and network troubleshooting for Arch Linux, CachyOS, and other distributions.
Next Steps
- host Guide - DNS lookup
- nslookup Guide - DNS queries
- DNS Servers - DNS server setup
- dig Documentation:
man dig
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.