Fresh Ubuntu 21.04 DNS problems

Hi I installed a portable Ubuntu using this article

However I have problems resolving DNS.
Sometimes browser cannot resolve github.com other times some other programs cannot resolve DNS correctly.

Example issue:

ping gihub.com → works
nslookup github.com → does not work
curl https://github.com → does not work
Web browser (chrome) can access github.com

other times all of above works or it takes a very very long time to load the page due to DNS resolution.

My network is set to get DNS server from DHCP server which is my router and this device with ubuntu is the only one that has described problems.

There are too many floating parts like, gnome, systemd-resolve, network manage and who knows what that I know very little about.

If anyone could guide me through the settings or pointing me to the solution / problem that I can work normally?
Eventually, would be downgrading to ubuntu 20.04 LTS a solution?
Also would be good to know where can I find what are supposed to be default settings.

Thank you

Hi!

I don’t see why downgrading should help in any way.

First, try adding these two lines to the file /etc/resolv.conf.

nameserver 8.8.8.8
nameserver 8.8.4.4

If your ISP’s name server is a bit unreliable, it often helps to have a backup.
However, the fact that some programs work and others not, suggests that the problem has another cause.

If the problem doesn’t go away, you might consider reinstalling curl and nslookup.

If the problem still persists, please come back, let us know and we’ll try to dig deeper.

1 Like

Hi Mina your solution is not really a solution since /etc/resolv.conf is managed by systemd-resolve and it can get overwritten at any point. I suspect my problem to be more likely systemd-resolve :confused:
I went through several issues on GH and it’s the indication.

1 Like

Maybe, but neither of the both suggestions (amending /etc/resolve.conf and reinstalling the recalcitrant application) is likely to cause any harm at all, so: did you try them? It’s a question of less than 5 minutes + a possible reboot.

Somehow it got fixed.