-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cache-min-ttl #1214
Comments
Thank you for the feature request! Let's see how many upvotes it gets |
This is the most voted request in open issues. |
CoreDNS supports this feature as much as serve_stale and prefetch. |
Assigned to v0.102 |
Since I configure this on dnsmasq or DNSCrypt-proxy currently, I'd like to request the following:
Those config directives and values are taken from DNSCrypt-proxy: https://github.com/DNSCrypt/dnscrypt-proxy/wiki/Caching If I had to pick, I'd say that |
Hmm, looks like (unless I'm way off base) the primary ttl/caching logic happens here: I don't know go much, but I might take a crack at implementing cache_min/max_ttl here. We'll see how free I am this weekend. |
Yeah, but I am not sure how safe would be to change that method. Maybe it'd be better to change |
Ahh okay, I'll take a look at what it will take to update I should be able to find some time in the next few days. |
Got a quick version put together, pushed here: https://github.com/adworacz/dnsproxy/tree/minMaxTTL However, it's still a WIP, as tests still need to be updated, and likely one or two other things (like the README). |
Cool, the only thing that I don't like are the default values. I suppose by default |
Fair enough - I was on the fence about this when I was working on it, so I'll support "unset" options for the min/max ttl, which should fix the existing tests in the process. I'll write a custom test specifically around the ttl overriding. |
Got unset ttl working, iterating on the tests now. All existing tests pass, but I wrote a custom one for ttl overrides, and that’s failing currently. I’m looking into the cause (while I learn Go at the same time). |
Okay got tests working! My branch is updated (linked above). I want to update the README to reflect the new CLI options, then I’ll submit a pull request to dnsproxy. Do y’all prefer squashed commits or are multiple commits in a PR okay? |
@adworacz cool, thank you! I'd prefer squashed |
Pull request for dnsproxy is up: AdguardTeam/dnsproxy#84 For anyone else reading along - this does not mean Adguard Home supports setting TTL's yet. The front end interface needs to be updated, now that the core DNS library has support for setting TTLs. |
Found in dnsmasq's man page:
Interesting that dnsmasq warns users when they use |
Yes, I think limiting it is reasonable |
Hmm okay, I can do that. Where’s the best place to store the constant representing the max? And do we want a simple min() call, passing in the two values, or more official validation? |
As this is just one Go package - you can simply add a new constant to the I don't think we should warn user if he uses a value larger than our limit, so a simple min() will suffice. |
We should warn in the help text, though |
Roger roger - I'll work on these updates (still without a proper go install on this laptop, will be on a better laptop soon). Update: I've added the cap, and associated help text. There's a few open questions on the pull request. Once those have been answered, I'll post a new revision. |
@lordraiden there's a task for that: #1587 |
Er, I don't like the limit of min-cache-ttl, we should believe our users can do the right thing, just like linux. |
Admins are using using very low DNS TTLs, making caching inefficient.
Could you please add the option to set a minimum TTL value and override the one provided?
Thank you.
The text was updated successfully, but these errors were encountered: