π ~1 min read
Table of contents
Symptom & Impact
Hostname resolution fails, breaking package updates and external API access.
Environment & Reproduction
Seen after VPN, DHCP, or resolver configuration changes.
resolvectl status
getent hosts deb.debian.org
cat /etc/resolv.conf
Root Cause Analysis
Invalid nameserver values, stale resolver symlinks, or per-link DNS conflicts.
Quick Triage
Check resolver target and active DNS servers.
ls -l /etc/resolv.conf
resolvectl dns
resolvectl query deb.debian.org
Step-by-Step Diagnosis
Inspect resolved logs and link DNS state.
journalctl -u systemd-resolved -n 120 --no-pager
networkctl status
grep -RIn "dns|resolve" /etc/systemd 2>/dev/null

Solution – Primary Fix
Set valid DNS servers, flush cache, and restart resolver.
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 deb.debian.org

Solution – Alternative Approaches
Define static DNS in resolved configuration for persistence.
sudoedit /etc/systemd/resolved.conf
sudo systemctl restart systemd-resolved
resolvectl status
Verification & Acceptance Criteria
DNS queries resolve and package metadata refresh completes.
getent hosts security.debian.org
resolvectl statistics
sudo apt update
Rollback Plan
Restore previous resolver file and restart service.
sudo cp -a /etc/systemd/resolved.conf /var/tmp/resolved.conf.bak.$(date +%s)
sudo systemctl restart systemd-resolved
resolvectl status
Prevention & Hardening
Define primary/fallback DNS and monitor resolver failures.
resolvectl status
journalctl -u systemd-resolved --since -1h --no-pager
cat /etc/resolv.conf
Related Errors & Cross-Refs
Often linked with default-route issues and outbound firewall restrictions.
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
Debian systemd-resolved operations and troubleshooting guides.
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.