📖 ~1 min read
Table of contents
Symptom & Impact
Hostname lookups randomly fail, impacting package installs, API calls, and service discovery.
Environment & Reproduction
Occurs with unstable upstream DNS, broken split-DNS config, or stale /etc/resolv.conf links.
Root Cause Analysis
Resolver stub and upstream settings diverge, producing timeout and SERVFAIL outcomes.
Quick Triage
Validate resolver status and test multiple DNS servers directly.
Step-by-Step Diagnosis
Run: resolvectl status; resolvectl query debian.org; dig @ debian.org +time=2 +tries=1; ls -l /etc/resolv.conf.

Solution – Primary Fix
Set stable DNS servers in resolved or network config, then run: sudo systemctl restart systemd-resolved; sudo resolvectl flush-caches.
Still having issues? Our Network Design team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Deploy local caching resolver (unbound/dnsmasq) with health-checked upstream pools.
Verification & Acceptance Criteria
Repeated DNS queries return consistent low-latency successful responses.
Rollback Plan
Revert to prior resolver settings and restart networking if new DNS path is unstable.
Prevention & Hardening
Monitor DNS error rate and enforce resilient resolver fallback policy per site.
Related Errors & Cross-Refs
Often appears with temporary failure in name resolution and apt mirror resolution errors.
Related tutorial: View the step-by-step tutorial for debian-12.
View all debian-12 tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
systemd-resolved man pages and Debian DNS troubleshooting 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.