Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
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.
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.
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 .