[Pdns-users] low TTL, recursor and preresolve

Kenneth Marshall ktm at rice.edu
Tue Mar 22 17:46:11 UTC 2011


On Tue, Mar 22, 2011 at 09:09:13AM -0700, Alfred B. M. Cordero wrote:
> On Thu, 17 Mar 2011 10:50:00 -0700 Kenneth Marshall <ktm at rice.edu> 
> wrote:
> >
> >You might be interested in this pre-release version that supports
> >what I described:
> >
> >http://mailman.powerdns.com/pipermail/pdns-users/2010-
> >November/007190.html
> 
> Thank you again Kenneth.  The next thing to understand is how to 
> differentiate a
> response that came from the cache from one that did not. Is there a 
> way to do
> that using lua?
> 
> For sake of discussion any TTL < 301 is changed to 86400.
> If a query is for xyz.com and the data is not cached and the TTL is
> 300 we change the TTL to 86400 and return the query results. Now 
> the data
> is stored in cache. As time passes a query for xyz.com is made and 
> the cached
> TTL < 301 again so the TTL is returned as 86400. The better thing 
> to do is to
> go make a new query, check the TTL and if TTL < 301 return 86400.
> 

I think that all you should need is to not disable the packet cache
with the setvariable() function. Then the first query will have its
TTL rewritten to 86400 and be put in the cache. Then when it has
been there for 24 hours, it will be queried for again, you script
will rewrite the TTL, rinse, repeat... 

Cheers,
Ken



More information about the Pdns-users mailing list