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

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
psychedelicgazelle

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

Post by psychedelicgazelle »

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.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

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

Post by xenopeek »

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
Locked

Return to “Networking”