How To Set Up Raspberry Pi As A DNS Server

Step 1: Update Packages

sudo apt update
sudo apt upgrade

Step 2: Install DNS Software

sudo apt install dnsmasq

Step 3: Configure DNSMasq

sudo nano /etc/dnsmasq.conf
  • domain-needed – Configures the DNS server to not forward names without a dot (.) or a domain name to upstream servers. Any names without a dot or domain stay in the local network.
  • bogus-priv – Stop DNS server from forwarding local IP range reverse-lookup queries to upstream DNS servers. That prevents leaking of the local network to upstream servers.
  • no-resolv – Stops reading the upstream nameservers from the /etc/resolv.conf file, relying instead on the ones in the DNSMasq configuration.
server=8.8.8.8
server=8.8.4.4
cache-size=1000

sudo systemctl restart dnsmasq
sudo systemctl status dnsmasq
Terminal output of dnsmasq status as active (running)

Reference site: https://phoenixnap.com/kb/raspberry-pi-dns-server

“How To Set Up Raspberry Pi As A DNS Server”에 대한 1개의 생각

댓글 남기기