Interview Prep/Linux/Networking, DNS and firewalls

`systemd-resolved` is running but lookups fail with `resolve call failed: All attempts to contact name servers or networks failed`.

IntermediateTroubleshootingNetworking, DNS and firewalls
Answer

Likely causes → resolved has no upstream DNS servers configured for any link, or DNSSEC/DoT settings fail with the upstream.

Diagnose →

resolvectl status
resolvectl query example.com
grep -Ev '^#|^$' /etc/systemd/resolved.conf

Fix → Set upstream servers per link (via NetworkManager/netplan) or globally (DNS=10.0.0.2 in resolved.conf), set DNSSEC=no or allow-downgrade if upstream doesn't support it, and systemctl restart systemd-resolved. Flush with resolvectl flush-caches.

Prevent → Include DNS checks in host monitoring.

All Linux questions Roadmap: Linux

More on Networking, DNS and firewalls