Arch Linux DNS Servers - ryzendew/Linux-Tips-and-Tricks GitHub Wiki

Arch Linux DNS Servers Guide

Complete beginner-friendly guide to DNS servers on Arch Linux, including Bind, dnsmasq, and DNS server configuration.


Table of Contents

  1. Bind Setup
  2. dnsmasq Setup
  3. DNS Configuration
  4. Troubleshooting

Bind Setup

Install Bind

Install Bind:

# Install Bind
sudo pacman -S bind

# Enable service
sudo systemctl enable named
sudo systemctl start named

Configure Bind

Edit config:

# Edit named config
sudo vim /etc/named.conf

dnsmasq Setup

Install dnsmasq

Install dnsmasq:

# Install dnsmasq
sudo pacman -S dnsmasq

# Enable service
sudo systemctl enable dnsmasq
sudo systemctl start dnsmasq

Configure dnsmasq

Edit config:

# Edit config
sudo vim /etc/dnsmasq.conf

Settings:

domain-needed
bogus-priv
listen-address=127.0.0.1

DNS Configuration

Test DNS

Test server:

# Query DNS
dig @localhost example.com

# Or
nslookup example.com localhost

Troubleshooting

DNS Not Resolving

Check logs:

# Check dnsmasq logs
sudo journalctl -u dnsmasq

# Check Bind logs
sudo journalctl -u named

Summary

This guide covered Bind, dnsmasq, DNS configuration, and troubleshooting.


Next Steps


This guide is based on the ArchWiki. For the most up-to-date information, always refer to the official ArchWiki.