resolv.conf gets overwritten with bad nameserver on reboot (DNS_PROBE_FINISHED_BAD_CONFIG)
The issue isn't a 'wrong' server getting set, it's the fact that 18.04 and later use ResolveD by default now, similar to how 14.04 and older used dnsmasq
to provide a DNS caching client.
127.0.0.53 is added by systemd-resolved
at reboot and startup. ResolveD gets its DNS configured by however you configured your Internet configuration on Netplan or Network Manager. If you haven't configured a DNS server properly in Netplan configuration then that's why ResolveD doesn't work, and if you don't get DNS servers via DHCP via either Netplan or Network Manager that's why it isn't working because it has no DNS servers to point to.
You can either fix your configuration (which you haven't shared so I can't be certain how you did the configuration of your system), or you can give ResolveD certain configuration options that act as backup configuration options for it by changing the configuration of /etc/systemd/resolved.conf
.
Edit the file as superuser, uncomment the DNS=
line by removing the #
at the beginning of the line, and set it to DNS=8.8.8.8
. Then do sudo systemctl restart systemd-resolved
and test the DNS. It should then work and default to 8.8.8.8 again for its queries, however resolv.conf
will still look at 127.0.0.53 which is normal behavior in modern Ubuntu systems. systemd-resolve --status
will; show what DNS servers are being used from network options or Global options based on what it got from network configurations or from your entered config in /etc/systemd/resolved.conf
.