How to Fix systemd-resolved High CPU Usage in Ubuntu

In Ubuntu and Debian-based distributions, systemd-resolved operates as the default network name resolution service, providing local DNS caching, LLMNR, and DNSSEC validation across network interfaces. Under normal circumstances, this daemon consumes negligible system resources. However, when misconfigured DNS search domains, aggressive mDNS broadcasting, cyclic query loops, or unresponsive upstream nameservers occur, systemd-resolved can spike to 100 percent CPU utilisation, driving up fan speeds and causing system lag. Resolving this requires breaking DNS loops, optimising DNSSEC settings, and resetting the local stub resolver.

Identify DNS Query Loops and Spiking CPU

Before modifying system configurations, inspect live process performance and system logs to confirm that systemd-resolved is indeed the culprit and examine incoming query volume.

  1. Open a terminal window and inspect active CPU usage:
    top -p $(pgrep -d',' -f systemd-resolved)
  2. Inspect recent resolution logs and daemon statistics:
    resolvectl statistics
  3. Check journal logs for recurring query retransmissions or loop warnings:
    sudo journalctl -u systemd-resolved -e -n 50
  4. If you observe hundreds of repeated queries for the same local hostname or reverse IP lookups within seconds, a loop is actively running between local network tools (like Docker or local VPN proxies) and the systemd stub listener.

Disable or Downgrade DNSSEC Validation

By default, Ubuntu enables opportunistic DNSSEC validation. When upstream routers or internet service providers modify DNS responses or fail to support cryptographic signing, systemd-resolved continuously recalculates validation signatures, consuming excessive CPU cycles.

  1. Edit the primary configuration file using nano:
    sudo nano /etc/systemd/resolved.conf
  2. Locate the [Resolve] section.
  3. Add or uncomment the DNSSEC line and set it to allow-downgrade or no:
    DNSSEC=allow-downgrade
  4. Disable Multicast DNS (mDNS) if you are on a congested local network with thousands of broadcast packets:
    MulticastDNS=no
  5. Press Ctrl + O and Enter to save, then press Ctrl + X to exit.
  6. Restart the service:
    sudo systemctl restart systemd-resolved

Flush the Local DNS Cache

Stale or corrupted negative cache entries (caching NXDOMAIN answers) can cause applications to trigger endless query bursts.

  1. Flush all cached DNS records stored in the memory buffer:
    sudo resolvectl flush-caches
  2. Verify that the cache counters have reset:
    resolvectl statistics
  3. Observe CPU utilisation in top to verify whether usage normalises.

Configure Explicit Upstream DNS Servers

If your local DHCP router delivers slow or unresponsive DNS servers, systemd-resolved spends substantial processor time managing timeout fallbacks across multiple network interfaces.

  1. Open /etc/systemd/resolved.conf again:
    sudo nano /etc/systemd/resolved.conf
  2. Specify reliable public upstream DNS servers under the [Resolve] section:
    DNS=1.1.1.1 8.8.8.8
    FallbackDNS=1.0.0.1 8.8.4.4
  3. Save the file and restart the resolver daemon:
    sudo systemctl restart systemd-resolved

Reset the Stub Resolver Symlink

If third-party network managers or VPN clients have altered /etc/resolv.conf, queries may bypass the internal cache entirely and flood the network stack.

  1. Verify that /etc/resolv.conf correctly symlinks to the systemd stub file:
    ls -l /etc/resolv.conf
  2. If the symlink is missing or points to an invalid path, recreate it cleanly:
    sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
  3. Restart both NetworkManager and systemd-resolved:
    sudo systemctl restart NetworkManager systemd-resolved

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.