Interview Prep/Linux/Networking, DNS and firewalls

`/etc/resolv.conf` changes you made disappear after a reboot or a few minutes.

BeginnerTroubleshootingNetworking, DNS and firewalls
Answer

Likely causes → The file is managed by NetworkManager, systemd-resolved (symlink to /run/systemd/resolve/stub-resolv.conf), netplan or DHCP client.

Diagnose →

ls -l /etc/resolv.conf
head -5 /etc/resolv.conf          # "Generated by NetworkManager" etc.

Fix → Configure DNS in the owning tool: nmcli con mod, netplan nameservers:, or /etc/systemd/resolved.conf DNS=. Then reapply.

Prevent → Never hand-edit a generated resolv.conf.

All Linux questions Roadmap: Linux

More on Networking, DNS and firewalls