From: Peter van Dijk Date: Tue, 30 Sep 2014 12:54:34 +0000 (+0200) Subject: add hidettl() example to powerdns-example-script.lua, closes #91 X-Git-Tag: rec-3.7.0-rc1~235 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=231d93de095ff80d542fc60837d289bc9cf56ab1;p=thirdparty%2Fpdns.git add hidettl() example to powerdns-example-script.lua, closes #91 --- diff --git a/pdns/powerdns-example-script.lua b/pdns/powerdns-example-script.lua index b67971ae95..44e2b8dc75 100644 --- a/pdns/powerdns-example-script.lua +++ b/pdns/powerdns-example-script.lua @@ -148,3 +148,13 @@ function prequery ( dnspacket ) pdnslog ("returning false") return false end + + +-- rename this function to 'postresolve' (and make sure you remove the other one!) to implement djb dnscache-like TTL hiding +function hidettl ( remoteip, domain, qtype, records, origrcode ) + for key,val in ipairs(records) + do + val.ttl=0 + end + return origrcode, records +end \ No newline at end of file