Skip to content

Commit

Permalink
Insert hints as non-auth into cache, so info received from the net is
Browse files Browse the repository at this point in the history
recorded in the cache.

Also make sure the root NS refresh happens more often if max-cache-ttl is low.
This is needed as the records no longer maintain the 1000 hours TTL.
In the existing setup, a reprime (with potential outdated info) was done at that
point in time since all root-server address records would expire at the same
time.

Lastly, fix a infinite (caught by depth check) recursion in getBestNSFromCache().

Fixes PowerDNS#10177.
  • Loading branch information
omoerbeek committed Mar 17, 2021
1 parent 41e749c commit fa9fb32
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 178 deletions.
4 changes: 2 additions & 2 deletions pdns/pdns_recursor.cc
Expand Up @@ -3514,8 +3514,8 @@ static void houseKeeping(void *)
}
last_RC_prune = now.tv_sec;
}
// XXX !!! global
if (now.tv_sec - last_rootupdate > 7200) {
// Divide by 12 to get the original 2 hour cycle if s_maxcachettl is default (1 day)
if (now.tv_sec - last_rootupdate > max(SyncRes::s_maxcachettl / 12, 10U)) {
int res = SyncRes::getRootNS(g_now, nullptr, 0);
if (!res) {
last_rootupdate=now.tv_sec;
Expand Down

0 comments on commit fa9fb32

Please sign in to comment.