ping: google.com: Temporary failure in name resolution

UbuntuDnsUbuntu 18.04

Ubuntu Problem Overview


ping: google.com: Temporary failure in name resolution

This problem is what's happing when trying to ping a domain instead of a IP, at this moment in the resolve.conf it has the 127.0.0.57 IP, tried adding this

nameserver 8.8.8.8

and it fixed the problem on the short term, im going to be running a daemon that need to contact my domain control panel. so I need a long term solution. If anyone has a solution to this issue it could be awesome.

Ubuntu Solutions


Solution 1 - Ubuntu

I've faced the exactly same problem but I've fixed it with another approache.

Using Ubuntu 18.04, first disable systemd-resolved service.

sudo systemctl disable systemd-resolved.service

Stop the service

sudo systemctl stop systemd-resolved.service

Then, remove the link to /run/systemd/resolve/stub-resolv.conf in /etc/resolv.conf

sudo rm /etc/resolv.conf

Add a manually created resolv.conf in /etc/

sudo vim /etc/resolv.conf

Add your prefered DNS server there

nameserver 208.67.222.222

I've tested this with success.

Solution 2 - Ubuntu

If you get the IP address from a DHCP server, you can also set the server to send a DNS server. Or add the nameserver 8.8.8.8 into /etc/resolvconf/resolv.conf.d/base file. The information in this file is included in the resolver configuration file even when no interfaces are configured.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNicolai JacobsenView Question on Stackoverflow
Solution 1 - UbuntuAndré M. FariaView Answer on Stackoverflow
Solution 2 - UbuntuDanView Answer on Stackoverflow