nscd and DNS cache

JD jd1008 at gmail.com
Wed May 16 06:54:03 UTC 2012


On Tue, May 15, 2012 at 9:20 PM, Ed Greshko <Ed.Greshko at greshko.com> wrote:
> On 05/16/2012 10:11 AM, JD wrote:
>> I have nscd running.
>> /etc/resolv.conf starts out with
>> nameserver 127.0.0.1
>> nameserver 192.168.1.254
>>
>>
>> The 192.168.1.254 is the router, which has been a fast and reliable resolver.
>>
>> So, to test nscd caching behavior,
>> I browse (using FF) over to any website.
>> After some time, the address is resolved and the page comes up.
>> I kill the tab of the page, and open a new tab and aim the browser
>> at same url. Browser again says: looking up whatever....com and takes
>> several seconds to resolve it.
>>
>> I thought that nscd is supposed to cache the translation from the
>> first lookup.
>>
>> Am I to believe that the browser is NOT using /etc/resolv.conf?
>> If not, what is it using?
>> Or could it be that nscd is useless in this respect?
>>
>
> I've not looked at nscd in a long time....but I never could see the value in it and
> never could get it to what I thought was a working or useful configuration for my needs.
>
> No browser or application uses resolv.conf directly.  They make calls to the resolver
> libraries which in turn use it.
>
> IMO, if your router does caching name services there really is no benefit to having
> systems do their own caching since the overhead of local requests should be small.
> However, it seems that your router may not be caching since it is taking several seconds.
>
> In cases where the router isn't doing caching, or is doing it poorly, I prefer to
> simply run bind on a single server and point all the systems to it for resolution.
>
> With the current Fedora systems this is easy.  All one need to do is install bind and
> bind-chroot and enable/start the service.  On the "bind" host all you need is
> 127.0.0.1 defined as a nameserver.  Then, if you use a tool such as "wireshark" you
> will see that requests will only go out if the answer is not in the cache or the TTL
> has expired.
>
I understand the libs are what make calls to the resolver. But even
the resolver must look
at /etc/resolv.conf. If it is empty, NOTHING gets resolved.
I was using nscd thinking it is a lightweight caching resolver. But as
it turns out it is useless.
Time for fedora to bury it :)
Re: My router: it does very little if any caching - and has no
configuration for it at all.

I will try bind.

Thanx Ed.

JD


More information about the users mailing list