I periodically have issues with the DNS setup on my Ubuntu desktop. I
finally decided to address this issue by forcing the DNS resolution to
go through DNS servers I specify, rather than using the default of
systemd-resolved. To do this, here are the steps:
About (1), edit your resolv.conf file and set the DNS servers you want, for example:
The final step (2) is to prevent NetworkManager from overwriting your
resolv.conf file. In order to do that, add the following under the
Reboot the computer and that should be it (and permanent).