How to Diagnose and Fix Port 53 DNS Conflicts on Linux
This guide explains why port 53 is occupied by the systemd‑resolve service, breaks down the UDP and TCP listeners shown by netstat, and provides step‑by‑step commands to stop, reconfigure, and restore DNS resolution on a Linux system.
Phenomenon
On Linux, port 53 is used for DNS resolution. Example netstat output shows the systemd-resolve daemon listening on both UDP and TCP on the local loopback interface.
systemd-r 20245 systemd-resolve 13u IPv4 216305 localhost:domain
systemd-r 20245 systemd-resolve 14u IPv4 216306 localhost:domain (LISTEN)Analysis
UDP socket
File descriptor 13 belongs to systemd-resolve.
It is a UDP socket bound to localhost (127.0.0.1) on port 53.
TCP listener
File descriptor 14 belongs to systemd-resolve.
It is a TCP socket in LISTEN state bound to localhost on port 53.
Service explanation
The systemd-resolve daemon provides local DNS resolution. It listens on UDP for standard queries and on TCP for larger or more complex responses.
Solution
To verify which process occupies port 53, run: sudo netstat -nultp If the output confirms that systemd-resolved is using the port, you can reconfigure or disable it:
Stop the service: sudo systemctl stop systemd-resolved Edit the configuration file /etc/systemd/resolved.conf (e.g., with vi) and set the desired options, for example:
[Resolve]
DNS=223.5.5.5
DNSStubListener=noSave the file and exit the editor.
Re‑create the /etc/resolv.conf symbolic link so that it points to the systemd resolver configuration:
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.confConclusion
Port 53 is normally occupied by a DNS service such as systemd-resolve. Other DNS servers (e.g., BIND, dnsmasq) may also bind to this port. Understanding the netstat output enables administrators to monitor DNS activity and adjust configurations when necessary.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
