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

  1. Check the Status of systemd-resolved: First, check if systemd-resolved is running:

    sudo systemctl status systemd-resolved
    

    If it’s active, you can proceed to stop and disable it.

  2. Stop systemd-resolved: Use the following command to stop the service:

    sudo systemctl stop systemd-resolved
    
  3. Disable systemd-resolved: To prevent it from starting on boot, disable it:

    sudo systemctl disable systemd-resolved
    
  4. Verify the Service is Stopped: After stopping the service, you can check again if it’s still using port 53:

    sudo lsof -i :53
    
  5. Change /etc/resolv.conf to point to active DNS servers:

    sudo rm /etc/resolv.conf
    
    sudo nano /etc/resolv.conf
    

    Add in desired DNS servers and save

    nameserver 1.1.1.1
    nameserver 1.0.0.1