The systemd-resolved service provides local network name resolution management for Ubuntu systems via a local DNS stub resolver listening on 127.0.0.53:53. It routes application DNS lookups to upstream nameservers configured by Netplan or NetworkManager. When systemd fails to launch the service during boot, DNS lookups break completely across the operating system: web browsers return ERR_NAME_NOT_RESOLVED, apt update fails with Temporary failure resolving, and systemctl status outputs: Failed to start systemd-resolved.service - Network Name Resolution.
Why Does systemd-resolved Fail to Start in Ubuntu?
The service fails when it cannot bind the DNS stub listener port, parse configuration files, or read symlink pointers. Common causes include:
- Port 53 (DNS) Socket Contention: Another local DNS server (such as
dnsmasq,bind9,unbound, or Pi-hole) is already bound to0.0.0.0:53, preventing systemd-resolved from listening on port 53. - Corrupted or Broken /etc/resolv.conf Symlink: The critical
/etc/resolv.conffile is replaced with a static unmanaged file or points to a non-existent stub path. - Syntax Errors in resolved.conf: Typographical errors or invalid DNS server IP addresses inside
/etc/systemd/resolved.conf. - AppArmor Profile Denial: Security profile constraints blocking the
systemd-resolveuser from accessing socket descriptors. - Corrupted DNSSEC Certificate Stacks: Strict DNSSEC validation failing on upstream networks that strip DNSSEC records.
Method 1: Identify and Resolve Port 53 Socket Conflicts
Check if a competing DNS daemon is monopolizing port 53.
- Open your terminal and query processes listening on UDP/TCP port 53:
sudo ss -tulpn | grep :53 - Check the process name in the output (e.g.
dnsmasq,named, orpihole-FTL). - If another DNS daemon is running, you must choose which service handles resolution:
- If you require the standalone DNS daemon (e.g. Dnsmasq), disable systemd-resolved’s DNS stub listener by editing
/etc/systemd/resolved.conf, settingDNSStubListener=no, and restarting. - If you want systemd-resolved to manage DNS, stop and disable the competing daemon:
sudo systemctl stop dnsmasq sudo systemctl disable dnsmasq
- If you require the standalone DNS daemon (e.g. Dnsmasq), disable systemd-resolved’s DNS stub listener by editing
- Start systemd-resolved:
sudo systemctl start systemd-resolved.service
Method 2: Restore the Proper /etc/resolv.conf Symlink
Ubuntu requires /etc/resolv.conf to be a dynamic symbolic link to the systemd stub file.
- Inspect the current file properties:
ls -l /etc/resolv.conf - If it is a static file or broken link, remove it:
sudo rm -f /etc/resolv.conf - Recreate the official symbolic link pointing to the systemd stub resolver:
sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf - Restart the service:
sudo systemctl restart systemd-resolved.service
Method 3: Disable Strict DNSSEC Validation
If your local ISP or router firewall corrupts DNSSEC packets, disable DNSSEC to restore resolution.
- Open the configuration file:
sudo nano /etc/systemd/resolved.conf - Locate the line
#DNSSEC=under the[Resolve]section. - Uncomment it and set it to
no:[Resolve] DNS=1.1.1.1 8.8.8.8 FallbackDNS=1.0.0.1 8.8.4.4 DNSSEC=no - Save and exit (Ctrl + O, Enter, Ctrl + X).
- Restart systemd-resolved:
sudo systemctl restart systemd-resolved.service
Method 4: Query Systemd Journal for Detailed Parse Errors
Examine journal logs to identify exact configuration file syntax errors.
- View the journal trace:
journalctl -u systemd-resolved.service -e --no-pager - Check for line numbers indicating syntax warnings.
- Correct any typos in
/etc/systemd/resolved.confor drop-in files in/etc/systemd/resolved.conf.d/.
Method 5: Verify DNS Resolution via resolvectl
Confirm that the resolver is active and handling queries.
- Query status:
resolvectl status - Verify that your active interface (e.g.
eth0orwlan0) lists valid DNS servers. - Test a live DNS query:
resolvectl query google.com - The command should return valid A and AAAA IP records with millisecond response times.