Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Optimum Dnsmasq configuration
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3184
Location: Illinois, USA

PostPosted: Tue Dec 11, 2018 4:56 pm    Post subject: Optimum Dnsmasq configuration Reply with quote

I don't understand the time to live settings in dnsmasq.conf. After googling, I'm confused if time-to-live refers to DHCP time to live (I'm not using Dnsmasq for DHCP, kust DNS lookup caching) or how long the client should keep the result or how long Dnsmasq keeps the results in it's own cache. If it's the last one, I think it should keep it for at least a day and not just seconds.

I have the following lines in my /etc/dnsmasq.conf that I'm requesting coments on:
Code:
dhcp-option=23,3600
cache-size=1000
#no-negcache
local-ttl=60

Aside from my own web surfing, there may be ebuid fetching going on and thunderbird checking for e-mail. I also have HP printer's, a Roku and two Amazon firesticks. They may be doing a lot of phoning home. I don't know if they are using my dnsmasq. How would they know where to look?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7230
Location: almost Mile High in the USA

PostPosted: Tue Dec 11, 2018 6:26 pm    Post subject: Reply with quote

Depends on how static the resources you're asking are.

It seems that local-ttl refers to how often the machine asking dnsmasq should re-poll for data that dnsmasq generated/knows like DHCP data, /etc/hosts of the dnsmasq server, and any config file data that could be passed to requesters versus stuff that's retrieved and forwarded from other servers. Anyway this stuff happens on your LAN so I suspect that unless your dnsmasq server is cpu limited, having a low TTL is not a big deal...

DNS data should honor the TTL that's forwarded from other servers, it shouldn't overwrite data received from other machines.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3184
Location: Illinois, USA

PostPosted: Sat Dec 15, 2018 12:45 am    Post subject: Reply with quote

I would guess that local-ttl of 600 would be plenty. It's highly unlikely that a website would change it's address in any given ten minute interval.

Does any parameter determine how long dnsmasq caches responses? IOW what is the time to live before dnsmasq retrieves a new address from a secondary server?

Is there any parameter that determines how long dnsmasq abandons a server as non-responsive and goes on to the next?
At different times I have had problems with all five servers in my /etc/dnsmasq.conf.resolv including my two ISP servers.

From the command line one can tell dnsmasq to query all servers simultaneously. Is this possible when launched as a background process?

Apologies for my late response. It's been a brutal week.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3184
Location: Illinois, USA

PostPosted: Sat Dec 15, 2018 12:47 am    Post subject: Reply with quote

eccerr0r wrote:
Depends on how static the resources you're asking are.


I wonder if I should put www.gentoo.org and forums.gentoo.org in my /etc/hosts
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7230
Location: almost Mile High in the USA

PostPosted: Sat Dec 15, 2018 6:22 am    Post subject: Reply with quote

again, the TTL passed from other upstream DNS servers should be honored If you get a TTL from another server like foo.dyndns.org, you should respect it. If the remote service sends you a low TTL for load balancing, that's what they want... Note that the TTL does not and should not get refreshed every time you request it unlike a normal LRU cache. It should time out when the TTL acquired with the upstream query expires.

The local TTL is only for your machines: your laptop.localdomain, /etc/hosts, etc - locally assigned services, not queried responses from google 4.2.2.2, not gentoo.org, not godaddy, none of these. Your local machines, if you make a local dnsmasq change, I'd imagine you want them to change instantly instead of having to wait 10 minutes.

I'm not sure there's a facility within dnsmasq to break dns protocol and assign your own TTLs just so you can cache longer.

I don't know what dnsmasq does for server timeouts, hopefully it would quickly ask another server if one doesn't respond in a timely fashion...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum