Affected versions: Ubuntu 26.04 LTS

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Hostnames fail to resolve, causing package downloads, API calls, and service discovery to break.

Environment & Reproduction

Often seen after network profile changes or manual edits to resolver files.

resolvectl status
cat /etc/resolv.conf
getent hosts archive.ubuntu.com
ping -c 2 ubuntu.com

Root Cause Analysis

Broken /etc/resolv.conf symlink, invalid upstream DNS, or stopped systemd-resolved service causes lookup failures.

Quick Triage

Check resolver service health and query behavior.

systemctl status systemd-resolved
resolvectl query ubuntu.com
journalctl -u systemd-resolved -n 80 --no-pager

Step-by-Step Diagnosis

Verify symlink integrity and test multiple upstream nameservers.

ls -l /etc/resolv.conf
readlink -f /etc/resolv.conf
resolvectl dns
resolvectl statistics
Illustrative mockup for ubuntu-26-04-lts — terminal_or_shell
Inspecting systemd-resolved status — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Restore resolved-managed resolver link and restart DNS components.

Still having issues? Our Network Design team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
sudo systemctl restart systemd-resolved
resolvectl flush-caches
resolvectl query archive.ubuntu.com
Illustrative mockup for ubuntu-26-04-lts — log_or_config
Correcting resolver settings and restoring lookups — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Set explicit DNS servers through netplan if DHCP-provided DNS is unreliable.

sudo tee /etc/netplan/99-dns.yaml >/dev/null <<'EOF'
network:
  version: 2
  ethernets:
    enp1s0:
      nameservers:
        addresses: [1.1.1.1,8.8.8.8]
EOF
sudo netplan apply

Verification & Acceptance Criteria

Lookups succeed consistently across key internal and external domains.

getent hosts ubuntu.com
resolvectl query security.ubuntu.com
sudo apt update

Rollback Plan

Restore prior resolver settings if custom DNS reduces reliability.

sudo rm -f /etc/netplan/99-dns.yaml
sudo netplan apply
sudo systemctl restart systemd-resolved

Prevention & Hardening

Manage DNS sources centrally and avoid direct manual edits to generated resolver files.

resolvectl status
systemctl is-enabled systemd-resolved
grep -RIn nameservers /etc/netplan

Frequently co-occurs with netplan syntax errors, VPN DNS split issues, and stale resolver caches.

Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.

View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Ubuntu resolver, netplan, and systemd-resolved operational guides.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.