Why are bad DNS query results being cached so often on my machine?

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
psychedelicgazelle
Level 1
Level 1
Posts: 4
Joined: Sat Mar 24, 2018 11:48 pm

Why are bad DNS query results being cached so often on my machine?

Post by psychedelicgazelle » Fri Apr 06, 2018 6:44 pm

My network controller is: Realtek Semiconductor Co., Ltd. Device d723

I have a bad internet connection where I live, and lose connectivity a lot. That's normal, but I've noticed that if I tried to visit a website while the wifi is down, that website usually results in a DNS_PROBE_FINISHED_NXDOMAIN error, which corresponds to a non-existent domain result from the DNS query, if I'm not mistaken.

This is easily resolved using the following command: sudo nscd -i hosts to flush the DNS cache.

I was wondering why I experience this error so often on Linux machines. I had thought it may have been some complicated reason related specifically to my old laptop, because it wasn't like that at first, but my new laptop with a fresh install of Linux has the same issue when I have poor connection. Wondered if anyone else could give some more insight into the DNS caching process and how bad results end up occurring and being cached.

User avatar
xenopeek
Level 24
Level 24
Posts: 22884
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Why are bad DNS query results being cached so often on my machine?

Post by xenopeek » Sat Apr 07, 2018 4:31 am

To be clear for anybody else reading this; nscd is a name service cache daemon. It is not installed on Linux Mint by default.

Linux Mint uses dnsmasq as a local DNS forwarder so that when using VPN connection DNS queries go to the correct network. It is specifically started with DNS caching disabled. No DNS caching happens at the operating system level though applications themselves may keep a short cache of DNS results (Firefox does this).

So I'd say this is specifically a question about nscd and not about Linux Mint general DNS handling (as that doesn't cache).
Image

Post Reply

Return to “Other networking topics”