LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to set dns timeout on dnsmasq (https://www.linuxquestions.org/questions/linux-server-73/how-to-set-dns-timeout-on-dnsmasq-747341/)

zelda32 08-13-2009 01:14 PM

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 :).

AlucardZero 08-13-2009 04:22 PM

in resolv.conf?
see: man resolv.conf

zelda32 08-14-2009 02:09 PM

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.

AlucardZero 08-14-2009 09:31 PM

No, it's for more than that. Read the man page for resolv.conf as I suggested. Or do you not want options timeout ??

catkin 08-15-2009 05:59 AM

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.

zelda32 08-17-2009 12:00 AM

Quote:

Originally Posted by AlucardZero (Post 3643899)
No, it's for more than that. Read the man page for resolv.conf as I suggested. Or do you not want options timeout ??

yes, i've read about that options timout:N. But, i am guessing that's for apps (browsers, messengers, etc) to set how long the apps gonna wait 'till dns query failed.

Thanks for all the help.

catkin 08-17-2009 02:24 AM

Quote:

Originally Posted by zelda32 (Post 3646049)
yes, i've read about that options timout:N. But, i am guessing that's for apps (browsers, messengers, etc) to set how long the apps gonna wait 'till dns query failed.

Thanks for all the help.

I would be very surprised if any apps use resolv.conf drirectly. The intended mechanism is that they call gethostbyname() which provides a common interface to whatever name resolution mechanisms are configured.

AlucardZero 08-17-2009 08:16 AM

Umm ok, what exactly do you mean by "dns timeout" then?

zelda32 08-31-2009 04:01 AM

Quote:

Originally Posted by AlucardZero (Post 3646429)
Umm ok, what exactly do you mean by "dns timeout" then?

the timeout when dnsmasq contacting the upstream server.

catkin 08-31-2009 05:43 AM

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?

zelda32 09-21-2009 02:03 AM

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 :).

hilou 06-01-2017 05:38 AM

Quote:

Originally Posted by catkin (Post 3663739)
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?

what if configured strict-order ? Which means dnsmasq should request the upstream servers one by one, what's the timeout then?


All times are GMT -5. The time now is 02:15 PM.