Среди прочего, unbound
может это сделать.
См. В его руководстве (https://www.nlnetlabs.nl/documentation/unbound/unbound.conf/) следующее:
cache-max-ttl: <seconds>
Time to live maximum for RRsets and messages in the cache.
Default is 86400 seconds (1 day). If the maximum kicks in,
responses to clients still get decrementing TTLs based on the
original (larger) values. When the internal TTL expires, the
cache item has expired. Can be set lower to force the resolver
to query for data often, and not trust (very large) TTL values.
cache-min-ttl: <seconds>
Time to live minimum for RRsets and messages in the cache.
Default is 0. If the minimum kicks in, the data is cached for
longer than the domain owner intended, and thus less queries are
made to look up the data. Zero makes sure the data in the cache
is as the domain owner intended, higher values, especially more
than an hour or so, can lead to trouble as the data in the cache
does not match up with the actual data any more.
cache-max-negative-ttl: <seconds>
Time to live maximum for negative responses, these have a SOA in
the authority section that is limited in time. Default is 3600.
This applies to nxdomain and nodata answers.
PS: ваш вопрос будет наиболее онтопическимо SoftwareRecommandations, чем здесь, поскольку это на самом деле не проблема программирования (или, по крайней мере, пока вы не решите запрограммировать такое программное обеспечение самостоятельно)