π ~1 min read
Table of contents
Symptom & Impact
Hostnames fail to resolve, breaking package downloads and API calls.
Environment & Reproduction
Occurs after resolver changes, VPN profile edits, or DHCP updates.
lsb_release -a
resolvectl status
getent hosts archive.ubuntu.com
Root Cause Analysis
Incorrect nameserver, stale stub resolver config, or link-specific DNS override.
Quick Triage
Check stub symlink and active DNS servers.
ls -l /etc/resolv.conf
resolvectl dns
resolvectl query ubuntu.com
Step-by-Step Diagnosis
Inspect journal and per-link DNS configuration.
journalctl -u systemd-resolved -n 120 --no-pager
networkctl status
resolvectl domain

Solution – Primary Fix
Set valid DNS servers and restart resolver stack.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo resolvectl dns eth0 1.1.1.1 8.8.8.8
sudo resolvectl flush-caches
sudo systemctl restart systemd-resolved
resolvectl query archive.ubuntu.com

Solution – Alternative Approaches
Persist DNS in netplan to survive reboot.
sudoedit /etc/netplan/01-netcfg.yaml
sudo netplan generate
sudo netplan apply
Verification & Acceptance Criteria
DNS lookups and apt update succeed.
getent hosts security.ubuntu.com
resolvectl statistics
sudo apt update
Rollback Plan
Restore previous netplan/resolver files from backup.
sudo cp -a /etc/netplan /var/tmp/netplan.rollback.$(date +%s)
sudo systemctl restart systemd-resolved
Prevention & Hardening
Define primary and fallback resolvers and monitor failures.
resolvectl status
systemd-analyze blame | head
journalctl -u systemd-resolved --since -1h --no-pager
Related Errors & Cross-Refs
Can coincide with broken default route or firewall egress blocks.
Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.
View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Ubuntu DNS and systemd-resolved operational guidance.
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.