Domain resolutions fail sometimes for some websites

So I have an odd issue where for some websites, DNS resolutions simply fail. One day may work while some days may not work (the pattern when the websites work and don’t work is not predictable) and the only way to access the websites is to use another device or browse with a VPN/proxy.

First conclusion was that it was a router issue, it can’t really be because other devices on my network ranging from windows to android are able to connect to these websites just fine at the same time as my machine is not.

For example today, Spotify decided not to work:

The troubling websites always hang until the ERR_ADDRESS_UNREACHABLE error occurs.

I have then thought it might’ve been a browser/chromium issue so I tried a non-chromium browser like Opera and the issue still occurs there.

So then I have tried pinging the domains from the ping utility and they return a response just fine:

~ $ ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=113 time=360 ms
64 bytes from ( icmp_seq=2 ttl=113 time=319 ms
64 bytes from ( icmp_seq=3 ttl=113 time=328 ms

I have then tried to change the DNS servers by setting managed=false and changing the resolv.conf file to Google and Cloudflare DNS servers:

# Generated by NetworkManager

And alas, restarting the whole system which sometimes fixes the issues.

Any idea on what’s going on? Thanks.

First thing I’d do in this situation is journalctl -f when the problem is happening. It may give you clues along the lines of UDP port 53, or DNS resolver.

Nothing to do with networks or DNS gets logged. Only time logs occur is if I close a window or open one.
Talks about the use of various tools for diagnosis.

Talks about similar issues

Also do inxi -N ? It maybe the driver at issue. RTL8168 is a real pain.