Affected versions: Debian 11

πŸ“– ~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 fail to resolve even though direct IP pings succeed.

Environment & Reproduction

Can occur after resolver changes, VPN setup, or DHCP lease renewal.

cat /etc/os-release
ping -c 2 1.1.1.1
getent hosts debian.org

Root Cause Analysis

Resolver configuration points to unreachable or invalid DNS servers.

Quick Triage

Check resolver status and active nameserver list.

cat /etc/resolv.conf
resolvectl status
systemctl status systemd-resolved --no-pager

Step-by-Step Diagnosis

Test individual nameservers and inspect DNS query failures.

dig @1.1.1.1 debian.org +short
dig @$(awk '/nameserver/{print $2;exit}' /etc/resolv.conf) debian.org +short
journalctl -u systemd-resolved --since '30 min ago'
Illustrative mockup for debian-11 β€” terminal_or_shell
Diagnostic output for networking/dns-resolution β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Set reliable DNS servers and restart resolver services.

Still having issues? Our Network Design 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 systemctl restart systemd-resolved
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
Illustrative mockup for debian-11 β€” log_or_config
Resolution output for networking/dns-resolution β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Configure static nameservers in ifupdown or NetworkManager profiles.

sudoedit /etc/network/interfaces
# add dns-nameservers 1.1.1.1 8.8.8.8
sudo systemctl restart networking

Verification & Acceptance Criteria

DNS lookups return expected records and application connectivity is restored.

getent hosts debian.org
ping -c 2 debian.org
apt update

Rollback Plan

Restore prior resolver configuration if service-specific DNS breaks.

sudo cp /root/resolv.conf.bak /etc/resolv.conf
sudo systemctl restart systemd-resolved

Prevention & Hardening

Standardize DNS policies and monitor resolver health metrics.

resolvectl statistics
systemctl is-active systemd-resolved

Related messages include temporary failure in name resolution and SERVFAIL.

Related tutorial: View the step-by-step tutorial for Debian 11.

View all Debian 11 tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

systemd-resolved and Debian DNS configuration documentation.

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.