π ~1 min read
Table of contents
Symptom & Impact
Host has network connectivity by IP but DNS lookups fail or time out.
Environment & Reproduction
Can occur after netplan changes, VPN client installation, or resolver file edits.
resolvectl status
cat /etc/resolv.conf
ping -c 3 1.1.1.1
ping -c 3 ubuntu.com
Root Cause Analysis
systemd-resolved receives bad upstream DNS settings or broken symlinked resolv.conf.
Quick Triage
Check resolver service and current DNS servers per interface.
systemctl status systemd-resolved --no-pager
resolvectl dns
resolvectl query archive.ubuntu.com
Step-by-Step Diagnosis
Trace interface-level DNS assignment and validate resolver path.
ip a
networkctl status
ls -l /etc/resolv.conf
resolvectl statistics

Solution – Primary Fix
Restore the correct resolv.conf symlink and set valid DNS in netplan.
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
sudoedit /etc/netplan/01-netcfg.yaml
sudo netplan apply
sudo systemctl restart systemd-resolved

Solution – Alternative Approaches
Set temporary DNS for immediate recovery and test upstream path.
sudo resolvectl dns eth0 1.1.1.1 8.8.8.8
resolvectl flush-caches
resolvectl query security.ubuntu.com
Verification & Acceptance Criteria
Lookups for internal and external names resolve consistently.
resolvectl query ubuntu.com
apt-cache policy
sudo apt update
Rollback Plan
Revert netplan YAML from backup and reapply.
sudo cp /etc/netplan/01-netcfg.yaml.bak /etc/netplan/01-netcfg.yaml
sudo netplan apply
Prevention & Hardening
Validate netplan and avoid direct manual edits to generated resolver files.
sudo netplan try
resolvectl status
Related Errors & Cross-Refs
Related messages include Temporary failure in name resolution and Could not resolve host.
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
Netplan and systemd-resolved documentation for Ubuntu 24.04 LTS.
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.