Score:1

Ubuntu 21.10: Problems with Internet access / DNS

ca flag

The question is partly a duplicate of multiple questions, but since I don't have enough reputation for commenting, this is my take on trying to understand the issue and prevent it from repeating.

So, I installed Ubuntu 21.10 on ASUS MINIPC PN51-E1 (AMD® Ryzen 7 5700u, radeon graphics AMD® Renoir) a few weeks ago and, mostly, all seemed ok. Then, the other day, probably after sudo apt upgrade, I tried to awake the computer from a sleep but it seemed frozen. I forced the shutdown by pressing long the power button.

When I restarted, I was not able to access the Internet anymore.

Many seem to have issues with networking. This, especially, helped me forward: Ubuntu Server 18.04 Temporary failure in name resolution. Apparently, there was a problem with my DNS setup, and /etc/resolv.conf might be the key (pinging returned "Temporary failure in name resolution").

I ended up removing the symlink and creating a static /etc/resolv.conf with only one line:

nameserver <ISP_DNS_server>

This recovered the Internet access. At least for the time being.

However, there are dozens of posts on problems related to /etc/resolv.conf, for example:

After reading all these, I'm still a bit lost:

  • What causes the problems?
  • Is my fix a good one, and permanent?
  • Should I install resolvconf? If yes, why it isn't already installed?

For example, I first tried to create /etc/resolvconf/resolv.conf.d/base and add nameserver info there, but it did not seem to work (I don't have resolvconf installed).

stt avatar
bg flag
stt
also had issues with DNS resolution in 22.04. basic restarting NetworkManager or dhclient didn't help, `nmcli device show eno1` claimed my dns was 192.168.1.1 which was reachable and working but no program could resolve addresses. haven't used ubuntu in a while and hadn't realised how complex DNS has gotten, found out you're supposed to do `resolvectl status eno1` now. it says it's empty, I do `resolvectl dns eno1 192.168.1.1` and then the browser starts working. (there was still DNS issues relating to LAN vs VPN but they're specific to my setup)
waltinator avatar
it flag
Read https://askubuntu.com/help/how-to-ask . Your multiple questions, long, detail-free ramble, premature attempt to diagnose before describing the problem (leading to inappropriate logvomit), lack of understanding of how things work, etc. make it impossible for us to provide AN answer.
teppo avatar
ca flag
Thanks for the constructive feedback. I updated the question to contain only the worry about the `/etc/resolv.conf` and DNS.
pierrely avatar
cn flag
at worst, and often lately, I resort to a clonezilla reinstalling of the entire root partition. I keep my home partition separate. sometimes deleting resolv.conf , deleting the ethernet connection in nm-connection-editor , maybe reboot, it sets it up again. also a killswitch option in my vpn has mucked things up with cannot resolve dns errors, . disabled temporarily. also I had set ubuntu to only have one ethernet connection, and that caused confusion.
pierrely avatar
cn flag
set back to do what it wants, disabled ipv6 another way (new connections have that enabled by default) and go with the flow. you also might like to chattr +i your resolv.conf to stop it changing, if that helps.
teppo avatar
ca flag
Thank for the advice @pierrely. I'll look into these. Also, after some more thinking, it does not seem a good idea to hard code the DNS server into settings (except if you really want to use a certain DNS server). Shouldn't the OS be able to change the server depending on the ISP..?
pierrely avatar
cn flag
my dns is set to depending on the vpn, avoiding the ISP's one or 8.8.8.8 google. and another thing changed was disabling IPv6. there are other ways to do that too. you can check on https://ipleak.net . resolv.conf is generated automatically. back it up if you have it, then delete it. it should regenerate
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.