[Dnsmasq-discuss] [PATCH] Make use-stale-cache configurable

Dominik Derigs dl6er at dl6er.de
Thu Nov 24 19:22:56 UTC 2022


Hey Simon,

We observed a few cache oddities with the current release-
candidate of dnsmasq and have been able to pin this down to the
use of the new use-stale-cache option. The issue happens with
cached content being served when the actual domain data has moved
on. This is, of course, unavoidable with this option, however, it
made me wanting a way to configure "serve stale data but only if
it is not too old". This is added by this patch adding an
optional argument:

--use-stale-cache[=<max TTL excess in s>]

In fact RFC 8767 "Serving Stale Data to Improve DNS Resiliency"
even states that

> The maximum stale timer should be configurable

The RFC suggests a "value is between 1 and 3 days" and later
states that "Shorter values, even less than a day, can
effectively handle the vast majority of outages." Hence, my patch
also changes the current (so far, unreleased) behavior from
serving expired content forever to a default value of one day.
This is freely configurable (I will set it down to one hour on
our systems) and can even be made serving forever, just as before
by explicitly setting the optional value to 0.

Best,
Dominik


Internal tracking is happening here:
https://github.com/pi-hole/dnsmasq/pull/11
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-use-stale-cache-configurable.-The-default-is-to.patch
Type: text/x-patch
Size: 7043 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20221124/d0c7bc6a/attachment.bin>


More information about the Dnsmasq-discuss mailing list