How to Fix Failed to Start Network Name Resolution in Ubuntu

Managing an Ubuntu server or desktop environment only to find that domain name queries fail with messages like Temporary failure in name resolution or seeing a degraded system state reporting Failed to start Network Name Resolution (systemd-resolved.service) breaks web browsing, package installations, and remote API calls. In modern Ubuntu releases, systemd-resolved operates as a local caching DNS stub resolver listening on 127.0.0.53:53. When the stub resolver configuration becomes invalid, the /etc/resolv.conf symlink breaks, or another DNS daemon (such as dnsmasq, named, or Docker bridge DNS) binds to port 53 before resolved initialises, systemd marks the service as failed. Resolving port conflicts, fixing symlinks, and setting fallback upstream DNS restores robust system name resolution.

Inspect Service Failure Logs and Port 53 Conflicts

Before modifying DNS configuration files, query the systemd journal to discover the exact reason systemd-resolved failed to bind.

  1. Open your terminal and inspect recent journal logs for the unit:
    journalctl -u systemd-resolved.service -e --no-pager
  2. Look for log entries indicating Failed to bind to socket: Address already in use.
  3. Check which local process is occupying port 53:
    sudo ss -tulpn | grep :53
  4. If a secondary service like dnsmasq or bind9 is binding to all interfaces (0.0.0.0:53), configure it to listen only on internal interfaces or disable it if redundant.

Restore the Standard systemd-resolved resolv.conf Symlink

Ubuntu requires /etc/resolv.conf to point dynamically to the systemd-resolved stub listener. If a manual script or third-party VPN overwrote this file with static text, name resolution desynchronises.

  1. Check the status of your current /etc/resolv.conf:
    ls -l /etc/resolv.conf
  2. If it is a static file or broken link, remove it:
    sudo rm -f /etc/resolv.conf
  3. Recreate the official symbolic link pointing to the systemd-resolved stub listener:
    sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
  4. If the runtime stub file does not exist yet due to service failure, link temporarily to upstream alternative:
    sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

Configure Static Upstream Fallback DNS in resolved.conf

If your local DHCP router provides malformed or unreachable DNS servers, provide reliable upstream public resolvers directly to systemd-resolved.

  1. Open the systemd-resolved configuration file in a text editor:
    sudo nano /etc/systemd/resolved.conf
  2. Under the [Resolve] section, configure reliable public DNS servers (such as Cloudflare and Google Public DNS):
    [Resolve]
    DNS=1.1.1.1 8.8.8.8
    FallbackDNS=1.0.0.1 8.8.4.4
    Domains=~.
    DNSSEC=no
    MulticastDNS=no
  3. Save the file by pressing Ctrl + O, then press Enter, and exit with Ctrl + X.
  4. Reset the failed service counter and restart the resolver daemon:
    sudo systemctl reset-failed systemd-resolved.service
    sudo systemctl restart systemd-resolved.service
    systemctl status systemd-resolved.service
  5. Verify that DNS resolution is functioning cleanly:
    resolvectl status
    ping -c 3 archive.ubuntu.com

Get the best tech tips delivered straight to your inbox.

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