programming / protocol question about client-side caching

Chris Buxton cbuxton at
Mon Jun 16 16:57:55 UTC 2008

On Jun 15, 2008, at 11:39 PM, Michael B Allen wrote:
> Hi,
> I'm not sure where to ask generic protocol questions (is c.p.d dead?)
> so please redirect me if necessary.
> I have an HTTP server module that does a lot of DNS SRV and A lookups
> for kerberos, ldap, etc. I have my own DNS client library to which I
> am currently adding a cache. However, I don't recall ever seeing a DNS
> client cache query results so I have to wonder if there's a reason.
> Is there any reason why a DNS client should *not* cache query results?
> Also, my cache can "round-robin" entries for a given name to emulate
> the behavior of a DNS server. But it's not smart enough to know if the
> server from which it retrieved the entries uses round-robin behavior
> or not. Is there any reason why a DNS client cache should *not*
> round-robin entries?
> Mike

Most stub resolvers now do include a cache.

- Windows has its DNS Client Service.
- Mac OS X has used lookupd, and now uses DirectoryService.
- Some Unix-like OS's use nscd, the Name Service Caching Daemon.
- Others use BIND 9's lwresd.

Just be sure that your cache mechanism honors TTL's, other than  
possibly applying a reasonable minimum and maximum.

There is no reason you should not use either round-robin or randomized  
order, or any other ordering you like. This is the default behavior of  
BIND and probably of several other implementations. There is no way  
for the resolver to tell if the responding server is applying RRSet  

Chris Buxton
Professional Services
Men & Mice

More information about the bind-users mailing list