Skip to content

[dnsdist] packetcache::get make skipAging configurable #5126

@opeter

Description

@opeter
  • Program: dnsdist
  • Issue type:Feature request

Short description

Behavior of dnsdist in front of an auth dns with cache pool enabled is wrong as it counts down the cached TTL.

Usecase

Put dnsdist in front of an auth dns and activate a cache pool.

Description

We want to put dnsdist in front of our auth nameserver and also use it's cache functionality.
Current behavior caches the records from the auth nameserver but counts down the TTL like a resolver.
From an authoritative point of view this is incorrect so it would be nice to have a feature flag to disable aging of the records.

Quick & Dirty patch:

diff --git a/pdns/dnsdist-cache.cc b/pdns/dnsdist-cache.cc
index 9b5b48c..9f5abd0 100644
--- a/pdns/dnsdist-cache.cc
+++ b/pdns/dnsdist-cache.cc
@@ -209,9 +209,9 @@ bool DNSDistPacketCache::get(const DNSQuestion& dq, uint16_t consumed, uint16_t
     }
   }
 
-  if (!skipAging) {
-    ageDNSPacket(response, *responseLen, age);
-  }
+  //if (!skipAging) {
+  //  ageDNSPacket(response, *responseLen, age);
+  //}
 
   d_hits++;
   return true;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions