Ubuntu DNS Failing: systemd-resolved in Four Commands

Symptom

ping 8.8.8.8 works; dig google.com fails.

Root cause

systemd-resolved misconfigured or the stub resolver lost its upstream.

Fix, in order

1. See what resolved thinks it is doingresolvectl status
2. Set DNS explicitly on the interfaceresolvectl dns eth0 1.1.1.1 8.8.8.8
3. Confirm the stub is actually listeningdig @127.0.0.53 google.com +short
4. Legacy tools: is /etc/resolv.conf the stub?nameserver 127.0.0.53 # should point at stub

Prevent it coming back

Pin DNS config in cloud-init/user-data so reboots cannot regress it.

Run it on clean infra

Spinning up a fresh box to reproduce or escape this error?

Managed cloud hosting

Related

Cloud & DevOps tool comparisons · Hardware build guides

NinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.

Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog