LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 08-13-2009, 02:14 PM   #1
zelda32
LQ Newbie
 
Registered: Aug 2009
Posts: 29

Rep: Reputation: 0
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 .
 
Old 08-13-2009, 05:22 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,653

Rep: Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536
in resolv.conf?
see: man resolv.conf
 
Old 08-14-2009, 03:09 PM   #3
zelda32
LQ Newbie
 
Registered: Aug 2009
Posts: 29

Original Poster
Rep: Reputation: 0
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.
 
Old 08-14-2009, 10:31 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,653

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

Last edited by AlucardZero; 08-14-2009 at 10:32 PM.
 
Old 08-15-2009, 06:59 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
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.
 
Old 08-17-2009, 01:00 AM   #6
zelda32
LQ Newbie
 
Registered: Aug 2009
Posts: 29

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AlucardZero View Post
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.
 
Old 08-17-2009, 03:24 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
Quote:
Originally Posted by zelda32 View Post
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.
 
Old 08-17-2009, 09:16 AM   #8
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,653

Rep: Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536
Umm ok, what exactly do you mean by "dns timeout" then?
 
Old 08-31-2009, 05:01 AM   #9
zelda32
LQ Newbie
 
Registered: Aug 2009
Posts: 29

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AlucardZero View Post
Umm ok, what exactly do you mean by "dns timeout" then?
the timeout when dnsmasq contacting the upstream server.
 
Old 08-31-2009, 06:43 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
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?
 
Old 09-21-2009, 03:03 AM   #11
zelda32
LQ Newbie
 
Registered: Aug 2009
Posts: 29

Original Poster
Rep: Reputation: 0
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 .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Managed DNS server lists and dnsmasq DNS cache nitrousoxide82 Linux - Networking 1 02-21-2014 11:34 PM
DNS cache without dnsmasq linuxbird Linux - Networking 8 10-29-2008 09:50 PM
LXer: Enhance your DNS and DHCP services with dnsmasq LXer Syndicated Linux News 0 10-04-2008 07:50 AM
TEMP_FAILURE: DNS Error: Timeout while contacting DNS servers when receiving emails tonysutherland Linux - Networking 2 02-10-2006 10:04 AM
is there a file where dnsmasq stores its cached dns? kublador Linux - Software 0 09-04-2004 08:01 AM


All times are GMT -5. The time now is 12:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration