Solution 1:

I found a solution online that seems to have worked, at least for me:

https://bbs.archlinux.org/viewtopic.php?id=230963&p=2

I followed nstarclix's procedure and removed some steps which were not possible in Ubuntu. Here's what worked for me:

First, modify the file /etc/NetworkManager/NetworkManager.conf and add the following lines:

[main]
dhcp=dhclient

(Also, make sure you have dhclient installed, I believe it's an Ubuntu default)

Then check the file /etc/resolv.conf, you should have the name server set to 127.0.0.53, it seems to be the default

Then the following commands:

sudo systemctl enable systemd-resolved.service
sudo systemctl disable systemd-networkd.service

Now reboot and hopefully everything will work, although I haven't tried this solution for a long period of time just yet.