[Feat] Unbound: Refresh local-zone ipset entry TTL on subsequent queries with matching IPs in RRSet #1336
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
1.2.3.4
=>4.3.2.1
, and then back to1.2.3.4
afterSee this table for example
This means worst case scenario is
DNS TTL - ipset TTL
of no ipset entry presence. In the worst case scenario a 60 second RRSet entry (for example) could have an ipset entry present for only 1 second if the query finishes on the last second that the ipset contains the ip.Note that bumping ipset TTL value itself might help reducing the occurrences, but not going to fully eliminate the problem
Solution
To make non-overlapping DNS cycles more palatable, Unbound can refresh/reset the TTL of an ipset set instead of leaving it at the current value. This applies when a DNS query responds with an IP that matches an existing ipset entry that was stored as a result of a previous DNS query
Notes
A follow up PR for a more comprehensive rework of ipset support has been raised here: #1335