Interview Prep/Linux/Networking, DNS and firewalls

`ping google.com` fails with `ping: google.com: Temporary failure in name resolution`, but `ping 8.8.8.8` works.

BeginnerTroubleshootingNetworking, DNS and firewalls
Answer

Likely causes → DNS is broken: no or wrong nameservers, resolver service down, or port 53 blocked.

Diagnose →

cat /etc/resolv.conf
resolvectl status 2>/dev/null
dig google.com @8.8.8.8          # does a public resolver work?
dig google.com                   # using system config

Fix → Point to working resolvers via NetworkManager/netplan (nmcli con mod eth0 ipv4.dns "10.0.0.2"), restart systemd-resolved if it's the one failing, or open UDP/TCP 53 egress.

Prevent → Two resolvers in config; monitor DNS resolution from hosts.

All Linux questions Roadmap: Linux

More on Networking, DNS and firewalls