📖 ~1 min read
Table of contents
Symptom & Impact
Hosts can ping IP addresses but domain resolution fails. apt update and outbound service calls fail with name resolution errors.
Environment & Reproduction
Ubuntu 22.04 using systemd-resolved and either netplan DHCP DNS or static resolver settings. Reproduce with invalid DNS server entries.
Root Cause Analysis
Broken upstream DNS, wrong netplan DNS config, or overridden /etc/resolv.conf symlink can disconnect libc resolver from systemd-resolved.
Quick Triage
Run resolvectl status, dig ubuntu.com @1.1.1.1, and verify /etc/resolv.conf points to stub-resolv.conf when expected.
Step-by-Step Diagnosis
Inspect resolver logs with journalctl -u systemd-resolved -b, check interface DNS assignment via resolvectl dns, and verify netplan DNS blocks.

Solution – Primary Fix
Set valid nameservers in netplan YAML or DHCP scope, apply changes with sudo netplan apply, then restart resolver: sudo systemctl restart systemd-resolved.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Temporarily set fallback DNS in /etc/systemd/resolved.conf and run sudo systemctl restart systemd-resolved.
Verification & Acceptance Criteria
dig and resolvectl query return expected results, apt update succeeds, and service endpoints resolve reliably.
Rollback Plan
Revert netplan or resolved.conf edits from backup and restart networking components.
Prevention & Hardening
Define redundant resolvers, monitor DNS latency, and enforce resolver configuration through automation.
Related Errors & Cross-Refs
Temporary failure resolving, Name or service not known, systemd-resolved degraded.
Related tutorial: View the step-by-step tutorial for Ubuntu 22.04 LTS.
View all Ubuntu 22.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
systemd-resolved docs, Ubuntu DNS troubleshooting guide, man resolvectl.
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.