Skip to content

Instantly share code, notes, and snippets.

@gh0stwizard
Last active November 27, 2018 09:32
Show Gist options
  • Save gh0stwizard/6540ea7b48db6f07c8e1018884d5fabb to your computer and use it in GitHub Desktop.
Save gh0stwizard/6540ea7b48db6f07c8e1018884d5fabb to your computer and use it in GitHub Desktop.
pdns-recursor 4.1.3 centos 7 x86_64 zero ttl patch
+.=10.10.10.1,10.10.10.2
--- pdns-recursor-4.1.3/syncres.cc.orig 2018-11-27 13:51:13.223002628 +0300
+++ pdns-recursor-4.1.3/syncres.cc 2018-11-27 13:53:06.996002787 +0300
@@ -2434,13 +2434,9 @@
// mark server as down
t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, "", 0), s_serverdownthrottletime, 10000);
}
- else if (resolveret == -1) {
- // unreachable, 1 minute or 100 queries
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 60, 100);
- }
else {
// timeout
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 10, 5);
+ t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), s_serverdownthrottletime, s_serverdownmaxfails);
}
}
@@ -2450,7 +2446,7 @@
/* we got an answer */
if(lwr.d_rcode==RCode::ServFail || lwr.d_rcode==RCode::Refused) {
LOG(prefix<<qname<<": "<<nsName<<" ("<<remoteIP.toString()<<") returned a "<< (lwr.d_rcode==RCode::ServFail ? "ServFail" : "Refused") << ", trying sibling IP or NS"<<endl);
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 60, 3);
+ t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), s_serverdownthrottletime, s_serverdownmaxfails);
return false;
}
--- pdns-recursor-4.1.3/syncres.hh.orig 2018-11-27 13:51:08.695002622 +0300
+++ pdns-recursor-4.1.3/syncres.hh 2018-11-27 13:51:52.237002682 +0300
@@ -107,7 +107,7 @@
void throttle(time_t now, const Thing& t, time_t ttl=0, unsigned int tries=0)
{
typename cont_t::iterator i=d_cont.find(t);
- entry e={ now+(ttl ? ttl : d_ttl), tries ? tries : d_limit};
+ entry e={ now+ttl, tries };
if(i==d_cont.end()) {
d_cont[t]=e;
--- /home/tvv/rpmbuild/SPECS/pdns-recursor.spec.orig 2018-11-27 13:55:55.338003021 +0300
+++ /home/tvv/rpmbuild/SPECS/pdns-recursor.spec 2018-11-27 14:00:16.685003386 +0300
@@ -1,6 +1,6 @@
Name: pdns-recursor
Version: 4.1.3
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Modern, advanced and high performance recursing/non authoritative name server
Group: System Environment/Daemons
License: GPLv2
@@ -8,6 +8,7 @@
Source0: https://downloads.powerdns.com/releases/%{name}-%{version}.tar.bz2
Patch0: fix-sigabort.patch
+Patch1: pdns-recursor-zero-ttl.patch
Provides: powerdns-recursor = %{version}-%{release}
BuildRequires: boost-devel
@@ -98,6 +99,9 @@
%doc COPYING README
%changelog
+* Tue Nov 27 2018 Vitaliy Tokarev <[email protected]> - 4.1.3-3
+- Remove hardcoded values for throttle
+
* Thu May 24 2018 Ruben Kerkhof <[email protected]> - 4.1.3-2
- Fix sigabort (#1578732)
- Enable support for ed25519
setuid=pdns-recursor
setgid=pdns-recursor
daemon=yes
forward-zones-file=/etc/pdns-recursor/forward.conf
forward-zones-recurse=.=10.10.10.1,.=10.10.10.2
local-address=127.0.0.1
local-port=53
logging-facility=3
minimum-ttl-override=86400
packetcache-servfail-ttl=0
server-down-max-fails=0
server-down-throttle-time=0
trace=off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment