2

I am currently running Ubuntu 20.04.4 LTS on my Macbook Pro. I connect it directly to my home modem via an ethernet connection. A few days ago, I suddenly lost connection to the internet. I ran the sudo ping command in Terminal and got a message that read “Temporary failure in name resolution” which confirms the lack of internet connection.

Here’s the odd part: I connect my iPhone directly to the same modem with an ethernet connection as well using a Belkin adapter and the internet on this phone runs perfectly fine (I’m writing this message from it). This rules out issues with my ISP or the modem itself.

Here is what I’ve tried so far but didn’t resolve the issue:

  • Changed the ethernet port on the back of the modem (one of the ports could have been defective)
  • Connecting via wifi
  • Ran ClamAV to ensure no infections were on my computer
  • Ran BleachBit to clean up files and clear cache/cookies

I can’t seem to figure out what went wrong.

  • that is, no internet through cable and wifi? but can you ping your router/modem? normally, connected devices receive private ip addresses or real ip? – Andra May 01 '22 at 15:19
  • To check connection more info is needed. Start with commands: ip a; ip r; cat /etc/netplan/*.yaml. Attach results to your question. – pasman pasmański May 01 '22 at 16:33
  • You might consider voting their answer if it helped you. Cheers. – Raffles May 02 '22 at 09:38

2 Answers2

3

This worked flawless after reboot:

Cannot explain why this was necessary, but the solution came down to ensuring that the wired interface was "managed". I changed /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf from:

[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:gsm,except:type:cdma

to:

[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:gsm,except:type:cdma,except:type:ethernet
Pilot6
  • 90,100
  • 91
  • 213
  • 324
BorbaB
  • 31
  • 1
2
sudo nano /etc/resolv.conf

add

nameserver 8.8.8.8

press ctrl+O then ctrl+x. type

nslookup google.com

does it work now?

  • I see “nameserver 127.0.0.53 “. Then the line below that reads “options edns0 trust-ad”. Do I overwrite 127.0.0.53 with 8.8.8.8? – Hg2X2Z9a4x3G May 01 '22 at 16:34
  • yes please. please change that line – helloubuntu May 01 '22 at 16:38
  • no problem. just add this line to that file and save it: nameserver 8.8.8.8 thats all – helloubuntu May 01 '22 at 16:44
  • When I type ctrl+O, I get a line that reads “File Name to Write: /etc/resolv.conf” Ctrl+X does nothing but make an error noise – Hg2X2Z9a4x3G May 01 '22 at 16:50
  • edit file, type ctrl+O, press enter, type ctrl+x. – helloubuntu May 01 '22 at 16:51
  • you may also test your connection with ping -c 1 google.com command. you may also need a restart after editing the file – helloubuntu May 01 '22 at 16:52
  • My goodness! It worked! Could you explain exactly what happened? I’ll be sure to archive your answers in a document! – Hg2X2Z9a4x3G May 01 '22 at 17:00
  • So easy. It is a common problem. I understood your problem within only 2 seconds. Some systems always change resolv.conf file. this file contains our DNS ip. we cant connect to internet without a DNS. so we have to type an exact DNS ip. 8.8.8.8 is Google's public DNS – helloubuntu May 01 '22 at 17:04
  • You’ve been very helpful. I have used the ip addresses 1.1.1.1 and 1.0.0.1 to route DNS requests through Cloudfare’s service in the past. Is there a way I can use those addresses? – Hg2X2Z9a4x3G May 01 '22 at 17:14
  • 1.1. 1.1 is a public DNS resolver operated by Cloudflare. so you can use it. no problem. just try. if you have any problem, just change the ip from resolv.conf. that's your ubuntu! – helloubuntu May 01 '22 at 17:16
  • 2
    Thank you very much for your extremely prompt assistance. I hope I’ll be able to pay it forward to another someday. – Hg2X2Z9a4x3G May 01 '22 at 17:19