`resolv.conf` keeps being overwritten and your manual nameserver change disappears.
BeginnerTroubleshootingDNS resolution failures
Answer
Likely causes → NetworkManager, systemd-resolved, dhclient or cloud-init manage the file.
Diagnose →
ls -l /etc/resolv.conf # symlink to ../run/systemd/resolve/stub-resolv.conf?
head -3 /etc/resolv.conf # "Generated by ..." line
Fix → Configure DNS at the owner: netplan nameservers:, nmcli con mod eth0 ipv4.dns 10.0.0.2, or /etc/systemd/resolved.conf DNS=.
Prevent → Never edit generated files; manage the source config with Ansible.
More on DNS resolution failures
`dig app.example.com` returns `status: NXDOMAIN`.Beginner`dig` returns `status: SERVFAIL` for one domain while other domains resolve fine.Intermediate`curl: (6) Could not resolve host: api.example.com` inside a container but it resolves on the host.BeginnerA DNS change was made 2 hours ago, but some users still reach the old IP.BeginnerJava service keeps connecting to an old IP long after the DNS record changed.IntermediateIn Kubernetes, external lookups from pods are slow and CoreDNS logs show many NXDOMAIN queries like `api.stripe.com.default.svc.cluster.local`.Intermediate