Don’t be suprised when you see Ubuntu is complaining port 53 is not avaiable. Most people won’t encounter this issue unless you are doing things with DNS. In default, port 53 is reserved by systemd-resolved

If you see errors like below and you have not done anything to use the DNS port. You are most likely affected by systemd-resol
failed to create listening socket for port 53: Address already in use [fail]
Error starting userland proxy: listen tcp4 0.0.0.0:53: bind: address already in use
You can confirm if you are affect by systemd-resol by checking listening ports and applications.
1 | sudo netstat -tulpn | grep LISTEN |
systemd-resol is listening on port 53.
1 | tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 18447/systemd-resol |
systemd-resolved is a system service that provides network name resolution to local applications. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR resolver and responder.
To stop systems-resolved using port 53 is easy
1. Edit /etc/systemd/resolved.conf set DNSStubListener to no
1 | sudo nano /etc/systemd/resolved.conf |
Your resolved.conf will looks like below. You can set DNS=8.8.8.8 to whatever DNS server you want the system to use. Without it your system won’t able to resolve any domain.
1 | [Resolve] |
2. Create a symbolic link for /run/systemd/resolve/resolv.conf with /etc/resolv.conf
1 | sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf |
This command remove existing /etc/resolv.conf if it exist and create a symbolic link
Comments