[Dnsmasq-discuss] Two questions about the cache and how dnsmasq forwards queries

Simon Kelley simon at thekelleys.org.uk
Thu Feb 11 21:18:38 GMT 2010


SamLT wrote:
> 
> Hello,
> 
> 
> I have a slow connection and every bit saved is precious! So I installed
> dnsmasq, but when I run dnsmasq -dq and watch what's happening, I can see
> two things that surprise me:
> 
> -> only few queries really benefit from the dnsmasq cache, and I think it
> happens when the name is actually a CNAME, but I'm not sure yet.
>  eg:
> 	* dig www.google.com
> 	* dnsmasq forwards the query then fills its cache with www.google.com
> 	being a CNAME to www.l.google.com, and an entry with the IP
> 	www.l.google.com resolved to
> 	
> 	* but if I issue again the dig command, dnsmask forwards again the
> 	query even though the entries haven't yet expired
> 	
> Note: I've just tried on an other computer(at home, other OS, other ISP...)
> and I don't see this behaviour, I leave the question untouched, since I may
> have missed a configuration option? I'll investigate on this further
> tomorow and report back.
> 
> 
That behaviour is not expected, but note that if any of the links in the 
CNAME chain expire, the query will have to be forwarded again. It's also 
  possible that the cache entries get thrown out if dnsmasq is busy and 
entries are not used. It's quite subtle, so you may need to do more 
experiments to understand what's happening.
> 
> 
> -> dnsmasq is supposed to help me saving bandwidth, but when it forwards a
> query, it forwards it to every nameserver (well, most of the time at
> least), isn't there a way to make it forward to only one server at a time,
> and to try an other one only if there was a problem (not found, server
> down..)
> 

It will normally forward to one nameserver, but every 10 seconds or 50 
queries it sends to all, to find which is fastest. If you are testing 
and sending a test query every 10 seconds or so, then it  might look 
like most queries go to all servers, but under load that's not true.

HTH

Simon.

> 
> 
> 
> At this point, if you combine the two above points, I'm in the situation
> where I have more dns traffic with dnsmasq than without it! and it's quite
> irritating...
> 
> Thanks for your help.
> 
> sam
> 
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 




More information about the Dnsmasq-discuss mailing list