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
If you see errors like below and you have not done anything to use the DNS port. You are most likely affected by
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.
sudo netstat -tulpn | grep LISTEN
systemd-resol is listening on port 53.
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
sudo nano /etc/systemd/resolved.conf
resolved.conf will looks like below. You can set
DNS=18.104.22.168 to whatever DNS server you want the system to use. Without it your system won’t able to resolve any domain.
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