Score:0

Can only browse the internet with Chromium on 20.04 - DNS issue?

in flag

I can browse the internet with Chromium on Ubuntu 20.04.

I cannot use Firefox and I cannot do apt-get update:

$ sudo apt-get update

Could not resolve 'actiontoad.canonical.com'

# etc...

I assume my DNS is somehow broken and that Chromium ignores system settings.

$ curl google.com

Could not resolve host: google.com

Any ideas?

Score:0
in flag

After much fighting, I discovered the issue.

Take a look at your /etc/nssswitch.conf

In my case, it had these lines:

# Use /etc/resolv.conf first, then fall back to systemd-resolved
hosts: files dns resolve myhostname mymachines
# Use systemd-resolved first, then fall back to /etc/resolv.conf
hosts: files resolve dns myhostname mymachines
# Don't use /etc/resolv.conf at all
hosts: files resolve myhostname mymachines

I changed it to this in order to get things working:

# Use /etc/resolv.conf first, then fall back to systemd-resolved
# hosts: files dns resolve myhostname mymachines

# Use systemd-resolved first, then fall back to /etc/resolv.conf
hosts: files resolve dns myhostname mymachines

# Don't use /etc/resolv.conf at all
# hosts: files resolve myhostname mymachines

Not even a restart required!

$ curl google.com                      
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

$ nslookup google.com
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.16.238
Name:   google.com
Address: 2a00:1450:4009:821::200e

What a painful episode. Good luck!

mpboden avatar
do flag
What was the reason your `/etc/nsswitch.conf` file had the `hosts` database defined three times? That seems odd to me. I haven’t tested this, but could the fact it was defined three times be the problem? Did you use one of the other definitions in your attempts to solve? Or only the middle one?
I sit in a Tesla and translated this thread with Ai:

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.