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

Hostnames fail to resolve, breaking package downloads and API calls.

Environment & Reproduction

Occurs after resolver changes, VPN profile edits, or DHCP updates.

lsb_release -a
resolvectl status
getent hosts archive.ubuntu.com

Root Cause Analysis

Incorrect nameserver, stale stub resolver config, or link-specific DNS override.

Quick Triage

Check stub symlink and active DNS servers.

ls -l /etc/resolv.conf
resolvectl dns
resolvectl query ubuntu.com

Step-by-Step Diagnosis

Inspect journal and per-link DNS configuration.

journalctl -u systemd-resolved -n 120 --no-pager
networkctl status
resolvectl domain
Illustrative mockup for ubuntu-24-04-lts β€” terminal_or_shell
Testing DNS queries β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Set valid DNS servers and restart resolver stack.

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 archive.ubuntu.com
Illustrative mockup for ubuntu-24-04-lts β€” log_or_config
Updating resolved and netplan DNS settings β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Persist DNS in netplan to survive reboot.

sudoedit /etc/netplan/01-netcfg.yaml
sudo netplan generate
sudo netplan apply

Verification & Acceptance Criteria

DNS lookups and apt update succeed.

getent hosts security.ubuntu.com
resolvectl statistics
sudo apt update

Rollback Plan

Restore previous netplan/resolver files from backup.

sudo cp -a /etc/netplan /var/tmp/netplan.rollback.$(date +%s)
sudo systemctl restart systemd-resolved

Prevention & Hardening

Define primary and fallback resolvers and monitor failures.

resolvectl status
systemd-analyze blame | head
journalctl -u systemd-resolved --since -1h --no-pager

Can coincide with broken default route or firewall egress blocks.

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

Ubuntu DNS and systemd-resolved operational 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.