Operations 5 min read

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.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Diagnose and Fix Port 53 DNS Conflicts on Linux

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=no

Save 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.conf

Conclusion

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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

network troubleshootingLinuxDNSport 53systemd-resolve
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.