0

I recently installed Ubuntu 20.04 LTS being a previous windows user. However, now I have the issue that neither Ethernet nor other WiFi connections let me access the internet. Other devices around me connect with no troubles. I have followed several other suggestions like this one but without success.

ping 8.8.8.8 yields PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data

and

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

I am not sure what other information to provide and would appreciate any suggestions.

Update: I came across this forum, where it was suggested to run the following commands:

sudo rm /etc/resolv.conf

sudo echo 'nameserver 8.8.8.8' | sudo tee /etc/resolv.conf

After running this, the internet connection begins to work. However, if I reboot the computer then I have to do it all over again.

As requested by @chili555, the output of ls -al /etc/resolv.conf is :

-rw-r--r-- 1 root root 19 Jul 7 17:36 /etc/resolv.conf

  • Look at the logs! sudo journalctl -b 0 -u NetworkManager. Read man journalctl. – waltinator Jul 07 '21 at 14:36
  • @nbob. Can you post the output of "ifconfig -a"? and also how are you connected to internet (hardware)? – jpbrain Jul 07 '21 at 14:40
  • @jpbrain itconfig is not found and I also cannot install it because no internet connection. I have tried both Ethernet cable and several wifi connections to connect – nbob Jul 07 '21 at 14:59
  • @waltinator sorry I am not sure how to interpret that output – nbob Jul 07 '21 at 15:08
  • Please edit your question to show the result of: ls -al /etc/resolv.conf Welcome to Ask Ubuntu. – chili555 Jul 07 '21 at 15:32

1 Answers1

1

The file resolv.conf is incorrect. Please do:

sudo rm -f /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

Now check:

ping -c3 www.ubuntu.com

If you get ping returns, you're all set.

chili555
  • 60,188
  • I followed the two commands, however ping -c3 www.ubuntu.com still returns "Temporary failure in name resolution" – nbob Jul 08 '21 at 09:38
  • How about: ping -c3 8.8.8.8 ? – chili555 Jul 08 '21 at 15:01
  • That yields PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data – nbob Jul 08 '21 at 15:35
  • Please reboot and try again: ping -c3 8.8.8.8 and: ls -al /etc/resolv.conf – chili555 Jul 08 '21 at 15:54
  • I rebooted then did sudo rm -f /etc/resolv.conf then sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf. The output from ls -al /etc/resolv.conf is lrwxrwxrwx 1 root root 32 Jul 8 21:49 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf. ping -c3 8.8.8.8 shows PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=18.1 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=117 time=16.9 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=117 time=16.1 ms and ping -c3 www.ubuntu.com gives temporary failure in name resolution – nbob Jul 08 '21 at 19:51
  • We have made some progress. You are connected to the internet but still cannont resolve names to numbers. Are there any settings in Network Manager that relate to DNS? https://www.liberiangeek.net/wp-content/uploads/2013/03/google_dns_provider_1_thumb.png – chili555 Jul 08 '21 at 20:33
  • When checking IPv4 or IPv6 in the current internet connection, they are both set to just "Automatic" and the DNS fields are empty. – nbob Jul 08 '21 at 20:37