πŸ“– ~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 intermittently fail to resolve, breaking apt, curl, and service discovery on Ubuntu 22.04.

Environment & Reproduction

Ubuntu 22.04 LTS using systemd-resolved with /etc/resolv.conf symlink to stub; reproduce under invalid upstream DNS or broken split-DNS setup.

Root Cause Analysis

Stub resolver depends on correct upstream servers and routing domains; stale links or conflicting resolv.conf changes lead to query failure.

Quick Triage

Check resolvectl status, verify /etc/resolv.conf target, and test direct queries with resolvectl query and dig.

Step-by-Step Diagnosis

Inspect journalctl -u systemd-resolved, confirm DNS servers per interface, and validate reachability to upstream resolvers over UDP/TCP 53.

Illustrative mockup for ubuntu-22-04-lts β€” dns_stub_problem
DNS lookup timeouts with systemd-resolved on Ubuntu 22.04 β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Set correct DNS in netplan or resolved config, restart systemd-resolved, then flush caches using resolvectl flush-caches.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Illustrative mockup for ubuntu-22-04-lts β€” dns_stub_solution
Resolved DNS configuration and successful queries on Ubuntu 22.04 β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Pin DNS in NetworkManager profiles, deploy local caching resolver, or configure fallback DNS for outage tolerance.

Verification & Acceptance Criteria

Repeated queries succeed, apt update completes, and latency remains stable across multiple network interfaces.

Rollback Plan

Revert changed netplan and resolved files, restore original /etc/resolv.conf symlink state, and restart network services.

Prevention & Hardening

Monitor DNS error rates, avoid ad-hoc edits to resolv.conf, and keep network automation source-of-truth centralized.

Related Ubuntu 22.04 problems include netplan misconfiguration, VPN split-DNS issues, and firewall rules blocking DNS.

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

man systemd-resolved, man resolvectl, Ubuntu DNS troubleshooting docs, and RFC 1035 basics.

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.