Affected versions: Ubuntu 26.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

Containers cannot resolve hostnames, breaking outbound API and package calls.

Environment & Reproduction

Appears after host resolver changes or Docker daemon restart.

docker run --rm busybox nslookup ubuntu.com

Root Cause Analysis

Docker DNS forwarding points to stale host resolver state or unreachable nameserver.

Quick Triage

Check Docker daemon config, bridge network, and host resolver state.

systemctl status docker
cat /etc/docker/daemon.json 2>/dev/null || true
resolvectl status

Step-by-Step Diagnosis

Inspect container /etc/resolv.conf and Docker network DNS behavior.

docker network inspect bridge
docker run --rm busybox cat /etc/resolv.conf
docker run --rm busybox nslookup archive.ubuntu.com
Illustrative mockup for ubuntu-26-04-lts β€” docker_dns_loss
Container DNS resolution failure after Docker restart β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Pin known-good DNS servers in Docker daemon and restart cleanly.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json >/dev/null <<'EOF'
{
  "dns": ["1.1.1.1", "8.8.8.8"]
}
EOF
sudo systemctl restart docker
Illustrative mockup for ubuntu-26-04-lts β€” docker_dns_restored
Docker daemon DNS config stabilized β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Set DNS per compose service for workload-specific resolver needs.

docker compose config

Verification & Acceptance Criteria

Containers resolve external and internal names consistently after restart.

docker run --rm busybox nslookup ubuntu.com
docker run --rm busybox wget -qO- https://example.com >/dev/null

Rollback Plan

Restore prior daemon.json and restart Docker daemon.

sudo cp /etc/docker/daemon.json.bak /etc/docker/daemon.json
sudo systemctl restart docker

Prevention & Hardening

Standardize daemon DNS settings and test after host resolver changes.

Related to nftables forwarding policy and bridge MTU mismatches.

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

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

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Docker daemon DNS configuration and Ubuntu resolver interoperability docs.

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.