`/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.
More on Networking, DNS and firewalls
`curl http://10.0.1.20:8080` returns `curl: (7) Failed to connect to 10.0.1.20 port 8080: Connection refused`.BeginnerThe same request instead hangs and ends with `curl: (28) Failed to connect to 10.0.1.20 port 8080 after 130000 ms: Connection timed out`. How is this different from "refused"?Beginner`ping google.com` fails with `ping: google.com: Temporary failure in name resolution`, but `ping 8.8.8.8` works.Beginner`dig api.internal` works, but the application and `curl` fail with `Could not resolve host: api.internal`.IntermediateDNS lookups take exactly 5 seconds before succeeding.IntermediateShort names like `db01` don't resolve, but `db01.corp.example.com` does.Beginner