📖 ~1 min read
Table of contents
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

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

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
Related Errors & Cross-Refs
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.