How to run a secure DNS server inside a Docker container to pair with AdGuardHome, Pi-Hole, and more.
Running a secure DNS server within a secure Docker container image allows you to run, host, replicate, and change DNS configurations. For example, if you want the default DNS, pull the image first.
Install Docker on Ubuntu/Debian using an automated install script, see: https://github.com/IhebRjeb/automated-docker-install
1. Default DNS: The magrddo/dns-proxy-server github project (recommended) is a secure DNS resolver to start with. It supports authorization, DNS recursion, wildcard, and RFC-1035 compliance
Link: https://github.com/mageddo/dns-proxy-server
Installation steps:
Ad-Blocking: docker run -d --name dns-proxy-server -p 8053:53/udp -p 8053:53/tcp defreitas/dns-proxy-server
Without Ad-Blocking: docker run -d --name dns-proxy-server -p 53:53/udp -p 53:53/tcp defreitas/dns-proxy-server
2. Cloudflare DNS: The qdm12/dns github project is a secure Cloudflare DNS resolver that starts with support for split-horizon DNS, blocking, auto-updates, rebinding protection, and DNSSEC validation
Link: https://github.com/qdm12/dns
Installation steps:
Ad-Blocking: docker run -d --name cloudflaredns -p 8053:53/udp qmcgaw/dns
Without Ad-Blocking: docker run -d --name cloudflaredns -p 53:53/udp qmcgaw/dns
For use with HomeLab Ad-Blocker for customized DNS resolver
1. For AdGuardHome: Login > Menu
> DNS Settings > Enter the DNS port for the Docker container.
2. For Pi-Hole: Login > Settings
> DNS Settings > Enter the DNS port for the Docker container.
Using the /etc/resolv.conf configuration file, consider backing up the file to another location before deleting /etc/resolv.conf, and safely restoring the file requires a script beforehand.
Note: If the systemd-resolved DNS resolver gets stuck, to avoid being locked out entirely if there's no internet connection, run 'systemctl stop systemd-resolved' and disable it on boot using 'systemctl disable systemd-resolved'. Using 'apt remove systemd-resolved' to uninstall it is strongly discouraged.


Comments
Post a Comment