Skip to content

Instantly share code, notes, and snippets.

@stephenchew
Last active June 2, 2023 09:12
Show Gist options
  • Select an option

  • Save stephenchew/dc2e285b264432b1996f402e695cebfa to your computer and use it in GitHub Desktop.

Select an option

Save stephenchew/dc2e285b264432b1996f402e695cebfa to your computer and use it in GitHub Desktop.
If port 53 is occupied...

Context

If you want to host a DNS server in a Linux environment (e.g. Ubuntu or raspbian), port 53/udp might be occupied by one of the services below. Use. ss or lsof to check the running service.

Stop systemd-resolved

  1. Edit the conf file

    sudo vim /etc/systemd/resolved.conf
  2. Uncomment the line DNSStubListener and set the value to no, like so:

    DNSStubListener=no
    
  3. Restart the service, or reboot if you're lazy

    sudo service systemd-resolved restart

Stop dnsmasq

  1. Stop the service
    sudo systemctl stop dnsmasq.service
  2. Disable autorun
    sudo systemctl disable dnsmasq.service

Reference

🔗 https://discourse.pi-hole.net/t/update-what-to-do-if-port-53-is-already-in-use/52033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment