ping: Temporary failure in name resolution

I tried speeding up DNS lookup in Ubuntu 17.04 and followed the instructions from the second post here: Ubuntu 17.04 systemd-resolved DNS lookups randomly fail

Result: once I reboot name resolution does not work at all:

ping www.google.com
ping: www.google.com: Temporary failure in name resolution

Everything works after I type

sudo systemctl restart systemd-resolved

How to fix this? Having to type this command after each reboot is less than ideal.


Posts are ordered by rank, so the "second post" could change over time. It appears it hasn't though and assuming you indeed followed instructions from:

https://superuser.com/a/1154386/293731

Then in the instructions you disabled systemd-resolved so it no longer starts automatically at boot. Just run this command and reboot, it should work again:

sudo systemctl enable systemd-resolved.service