Cache zero-TTL DNS replies when stale-caching is enabled.

This commit is contained in:
Simon Kelley
2023-10-09 21:15:13 +01:00
parent 8b606543a3
commit ca8d04a8ff

View File

@@ -629,8 +629,8 @@ static struct crec *really_insert(char *name, union all_addr *addr, unsigned sho
if (insert_error) if (insert_error)
return NULL; return NULL;
/* we don't cache zero-TTL records. */ /* we don't cache zero-TTL records unless we're doing stale-caching. */
if (ttl == 0) if (daemon->cache_max_expiry == 0 && ttl == 0)
{ {
insert_error = 1; insert_error = 1;
return NULL; return NULL;