[Dnsmasq-discuss] DNSmasq periodically slow

Simon Kelley simon@thekelleys.org.uk
Tue, 14 Dec 2004 10:49:10 +0000

kyrre@solution-forge.net wrote:
> Hello my name is Kyrre Sjøbæk, and i am running a small network of Linux
> workstations and servers.
> To provide them with DNS, we use DNSMASQ running on a Debian box (together
> with LDAP and NFS), which provides exactly what we need - a ligthning fast
> DNS server that is really easy to configure, and in which we can add local
> dns entries easily.
> Now, sometimes the server isn't that fast - it takes maybe 10 secounds to
> get an DNS answer from the server, but if you SSH in, lookup *on* the box
> is fast.  Lookups from the "outside" to localy defined (/etc/hosts) hosts
> are also fast.
> This occurs on a irregular interval, so every time i get around to really
> debug it, the problem is gone...
> Have anyone else experienced this problem before? I have really no idea
> whats wrong...

Try enabling DNS query logging on dnsmasq, that should give you some 
idea what the problem is.

There's not enough information in your message to be sure, but my guess 
is that one of your upstream nameservers is sometimes slow or 
unresponsive. The 10 second delay is the retry time for the the 
resolver: it doesn't get an answer for 10 seconds, so it re-sends the 
query to dnsmasq. When dnsmasq sees a retry on a query, it acts very 
conservatively and sends the query to _all_ the configured upstream 
servers, in parallel. This both ensures that the query gets answered 
this time, and gives dnsmasq a way of deciding which upstream server to 
use in the future (the one which answers the query fastest).

Your tests by sshing in and looking up queries on the box are only valid 
if you pick new names to test. If you try a name which just resolved 
slowly elsewhere than it will now be in the cache, and go fast.