When I build a Pi-Hole server I usually install it in Docker on an Ubuntu Server on an old Raspberry Pi or Intel NUC.
The default install of Ubuntu has systemd-resolved installed which clashes when you bring the Pi-hole Docker container up.
I can never remember the steps to disable systemd-resolved so this is my reminder :-)
Stop and Disable systemd-resolved
-
Check the Status of
systemd-resolved: First, check ifsystemd-resolvedis running:sudo systemctl status systemd-resolvedIf it’s active, you can proceed to stop and disable it.
-
Stop
systemd-resolved: Use the following command to stop the service:sudo systemctl stop systemd-resolved -
Disable
systemd-resolved: To prevent it from starting on boot, disable it:sudo systemctl disable systemd-resolved -
Verify the Service is Stopped: After stopping the service, you can check again if it’s still using port 53:
sudo lsof -i :53 -
Change /etc/resolv.conf to point to active DNS servers:
sudo rm /etc/resolv.confsudo nano /etc/resolv.confAdd in desired DNS servers and save
nameserver 1.1.1.1 nameserver 1.0.0.1