Affected versions: Ubuntu 24.04 LTS

πŸ“– ~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

Host has network connectivity by IP but DNS lookups fail or time out.

Environment & Reproduction

Can occur after netplan changes, VPN client installation, or resolver file edits.

resolvectl status
cat /etc/resolv.conf
ping -c 3 1.1.1.1
ping -c 3 ubuntu.com

Root Cause Analysis

systemd-resolved receives bad upstream DNS settings or broken symlinked resolv.conf.

Quick Triage

Check resolver service and current DNS servers per interface.

systemctl status systemd-resolved --no-pager
resolvectl dns
resolvectl query archive.ubuntu.com

Step-by-Step Diagnosis

Trace interface-level DNS assignment and validate resolver path.

ip a
networkctl status
ls -l /etc/resolv.conf
resolvectl statistics
Illustrative mockup for ubuntu-24-04-lts β€” terminal_or_shell
Diagnostic output for networking/dns-resolver β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Restore the correct resolv.conf symlink and set valid DNS in netplan.

Still having issues? Our Network Design team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
sudoedit /etc/netplan/01-netcfg.yaml
sudo netplan apply
sudo systemctl restart systemd-resolved
Illustrative mockup for ubuntu-24-04-lts β€” log_or_console
Resolution output for networking/dns-resolver β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Set temporary DNS for immediate recovery and test upstream path.

sudo resolvectl dns eth0 1.1.1.1 8.8.8.8
resolvectl flush-caches
resolvectl query security.ubuntu.com

Verification & Acceptance Criteria

Lookups for internal and external names resolve consistently.

resolvectl query ubuntu.com
apt-cache policy
sudo apt update

Rollback Plan

Revert netplan YAML from backup and reapply.

sudo cp /etc/netplan/01-netcfg.yaml.bak /etc/netplan/01-netcfg.yaml
sudo netplan apply

Prevention & Hardening

Validate netplan and avoid direct manual edits to generated resolver files.

sudo netplan try
resolvectl status

Related messages include Temporary failure in name resolution and Could not resolve host.

Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.

View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Netplan and systemd-resolved documentation for Ubuntu 24.04 LTS.

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.