How to set dns timeout on dnsmasq
How to set dns timeout on dnsmasq ?
i've read the manual, it doesn't say any. If not, what's the default value ? I am using dnsmasq ver. 2.49. Thanks :). |
in resolv.conf?
see: man resolv.conf |
thanks for the reply.
But /etc/resolv.conf is for putting system-wide upstream dns server ip address. i am thinking some entry for dnsmasq.conf. |
No, it's for more than that. Read the man page for resolv.conf as I suggested. Or do you not want options timeout ??
|
dnsmasq doesn't need a timeout because, on initialisation, it queries all the DNS servers it is given in parallel and chooses the fastest. Thereafter it changes DNS server dynamically, presumably when the fastest slows down (logging doesn't give fine enough timestamps to be certain but it looks like this is what's happening). For more insight, uncomment log-queries in dnsmasq.conf and view the (copious) output in /var/log/daemon.log.
I'm not sure but dnsmasq may only use the first three servers listed in resolv.conf (that's the default way of using it). I'm sure that it uses all the DNS servers listed in whatever's given on resolv-file in dnsmasq.conf, conventionally /etc/resolv.dnsmasq.conf. Brilliant utility, dnsmasq; it has dramatically changed my browsing experience when connected to an ISP with an iffy DNS service. |
Quote:
Thanks for all the help. |
Quote:
|
Umm ok, what exactly do you mean by "dns timeout" then?
|
Quote:
|
Ah -- you mean how long dnsmasq will wait for upstream DNS server(s) to reply before returning "timed out" to the application that asked dnsmasq to resolve a DNS name?
In the absence of any documentation to the contrary I expect dnsmasq to follow resolv.conf documentation. That means a default of 5 seconds before trying further DNS servers or as configured by timeout:<n> in resolv.conf. Presumably, if dnsmasq is configured not to read resolv.conf, it does not see any timeout:<n> and the 5 second default applies. This behaviour is complicated by dnsmasq's sophistication. dnsmasq sometimes queries several upstream DNS server(s) at the same time. I think it is adaptive and queries only one as long as it is responsive but switches to querying more when performance drops off. This could result in timing out faster than the traditional mechanism which tries each of a maximum of 3 DNS servers for 5 seconds so, on default settings, takes 15 seconds to inform the requesting application that a query has timed out. Or, if dnsmasq has been configured to use a large number of DNS servers, it could take longer. What is your issue? What symptoms are you seeing? |
well, i am using internet->dnsmasq->squid->clients. squid sometimes tells that it cannot resolve a domain 1-2 seconds after the clients request it.
At 1st i tought perhaps the problem lies on dnsmasq 'cos its resolve timeout. But after further research, the problem lies on squid, i added this line on squid.conf : negative_ttl 0 seconds Now the problem gone. Thank You for all your help :). |
Quote:
|
All times are GMT -5. The time now is 02:15 PM. |