How to fix "unable to bind to port 53" error

This is an excerpt from hopefully the more specific title will help people find this more easily.


When trying to run pihole in a container on docker, you get:

Error starting userland proxy: listen tcp4 bind: address already in use


Another service is using port 53 already.

On Ubuntu this is systemd-resolved.


  1. Edit /etc/systemd/resolved.conf
  2. Uncomment the line with DNSStubListener and change yes to no. Save. Exit
  3. sudo systemctl restart systemd-resolved.service
  4. sudo rm /etc/resolve.conf
  5. sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

Steps 1-3 stops systemd-resolved from binding to port 53. This prevents the system from doing DNS lookups. Steps 4-5 fixes that.