Skip to content

Linux dig Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

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

  1. dig Installation
  2. dig Basics
  3. DNS Queries
  4. Query Types
  5. Troubleshooting

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


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally