Add --min-cache-ttl option.

This commit is contained in:
RinSatsuki authored and Simon Kelley committed 2015-01-10 15:22:21 +00:00
1 parent 25cf5e373e
commit 28de38768e
6 files changed
+29 -2

No files matched your search

+3 -1
View File
@@ -461,9 +461,11 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
if (flags & (F_IPV4 | F_IPV6 | F_CNAME))
{
log_query(flags | F_UPSTREAM, name, addr, NULL);
/* Don;t mess with TTL for DNSSEC records. */
/* Don't mess with TTL for DNSSEC records. */
if (daemon->max_cache_ttl != 0 && daemon->max_cache_ttl < ttl)
ttl = daemon->max_cache_ttl;
if (daemon->min_cache_ttl != 0 && daemon->min_cache_ttl > ttl)
ttl = daemon->min_cache_ttl;
}
/* if previous insertion failed give up now. */