]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Remove the send-root-referral option 3586/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 17 Mar 2016 09:21:10 +0000 (10:21 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 17 Mar 2016 09:21:10 +0000 (10:21 +0100)
This was already disabled and is wrong and bad:
https://www.dns-oarc.net/oarc/articles/upward-referrals-considered-harmful

17 files changed:
docs/markdown/authoritative/settings.md
modules/luabackend/test/pdns
modules/tinydnsbackend/generate-data.sh
pdns/common_startup.cc
pdns/packethandler.cc
pdns/pdns.conf-dist
pdns/speedtest.cc
regression-tests.api/runtests.py
regression-tests.nobackend/edns-packet-cache/command
regression-tests.nobackend/edns1/command
regression-tests.nobackend/lua-policy/command
regression-tests.nobackend/negcache-tests-dotted-cname/command
regression-tests.nobackend/soa-edit/pdns.conf
regression-tests.nobackend/supermaster-signed/command
regression-tests.nobackend/supermaster-unsigned/command
regression-tests/README.md
regression-tests/tests/bind-add-zone/stress/run.sh

index 2cdd7e53861a9ea870e8dc3281bff4443c226072..8d61d92548a19fe3b3a2ed01d5cf06c84bd6fb4d 100644 (file)
@@ -647,16 +647,6 @@ If set, recursive queries will be handed to the recursor specified here. See
 
 Number of AXFR slave threads to start.
 
-## `send-root-referral`
-* Boolean or `lean`
-* Default: no
-
-if set, PowerDNS will send out old-fashioned root-referrals when queried for
-domains for which it is not authoritative. Wastes some bandwidth but may solve
-incoming query floods if domains are delegated to you for which you are not
-authoritative, but which are queried by broken recursors. It is possible to
-specify 'lean' root referrals, which waste less bandwidth.
-
 ## `setgid`
 * String
 
index 44fa78b70f70a6ded2d01bd3cdd43d1e31571812..981414816dc02a5bb0eaf3a4c60fafa8a88f3697 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
 
 ../../../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./  \
---no-shuffle --launch=lua --send-root-referral --loglevel=9 \
+--no-shuffle --launch=lua --loglevel=9 \
 --config-dir=./ --cache-ttl=0 --negquery-cache-ttl=0 --query-cache-ttl=0 --recursive-cache-ttl=0
index 99f441022f48f4fe1f13456c28256fc929563f25..ea1925fa2036706847fdb8cd6b84576148fb0502 100755 (executable)
@@ -20,7 +20,7 @@ done
 cd ../../regression-tests
 ../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ \
   --no-shuffle --launch=bind --bind-config=../regression-tests/named.conf \
-  --query-logging --send-root-referral --loglevel=0 \
+  --query-logging --loglevel=0 \
   --cache-ttl=0 --no-config --local-address=127.0.0.1 \
   --bind-ignore-broken-records=yes --module-dir=modules &
 
index fb4195418b941a277b621f461c0a823fe9862d60..295eaf004f66d35a06790e1ef8e44c8cf6d06822 100644 (file)
@@ -119,7 +119,6 @@ void declareArguments()
   ::arg().setSwitch("master","Act as a master")="no";
   ::arg().setSwitch("disable-axfr-rectify","Disable the rectify step during an outgoing AXFR. Only required for regression testing.")="no";
   ::arg().setSwitch("guardian","Run within a guardian process")="no";
-  ::arg().setSwitch("send-root-referral","Send out old-fashioned root-referral instead of ServFail in case of no authority")="no";
   ::arg().setSwitch("prevent-self-notification","Don't send notifications to what we think is ourself")="yes";
   ::arg().setSwitch("webserver","Start a webserver for monitoring")="no"; 
   ::arg().setSwitch("webserver-print-arguments","If the webserver should print arguments")="no"; 
index caedb337780582fc732e537966aa153300eef205..44405d77d31addd48533729f15d7b70e0818cd10 100644 (file)
@@ -55,12 +55,6 @@ AtomicCounter PacketHandler::s_count;
 NetmaskGroup PacketHandler::s_allowNotifyFrom;
 extern string s_programname;
 
-enum root_referral {
-    NO_ROOT_REFERRAL,
-    LEAN_ROOT_REFERRAL,
-    FULL_ROOT_REFERRAL
-};
-
 PacketHandler::PacketHandler():B(s_programname), d_dk(&B)
 {
   ++s_count;
@@ -68,9 +62,6 @@ PacketHandler::PacketHandler():B(s_programname), d_dk(&B)
   d_doRecursion= ::arg().mustDo("recursor");
   d_logDNSDetails= ::arg().mustDo("log-dns-details");
   d_doIPv6AdditionalProcessing = ::arg().mustDo("do-ipv6-additional-processing");
-  d_sendRootReferral = ::arg().mustDo("send-root-referral")
-                            ? ( pdns_iequals(::arg()["send-root-referral"], "lean") ? LEAN_ROOT_REFERRAL : FULL_ROOT_REFERRAL )
-                            : NO_ROOT_REFERRAL;
   string fname= ::arg()["lua-prequery-script"];
   if(fname.empty())
   {
@@ -94,44 +85,6 @@ PacketHandler::~PacketHandler()
   DLOG(L<<Logger::Error<<"PacketHandler destructor called - "<<s_count<<" left"<<endl);
 }
 
-void PacketHandler::addRootReferral(DNSPacket* r)
-{  
-  // nobody reads what we output, but it appears to be the magic that shuts some nameservers up
-  static const char*ips[]={"198.41.0.4", "192.228.79.201", "192.33.4.12", "199.7.91.13", "192.203.230.10", "192.5.5.241", "192.112.36.4", "198.97.190.53", 
-                     "192.36.148.17","192.58.128.30", "193.0.14.129", "199.7.83.42", "202.12.27.33"};
-  static char templ[40];
-  strncpy(templ,"a.root-servers.net", sizeof(templ) - 1);
-
-  // add . NS records
-  DNSResourceRecord rr;
-  rr.qname = DNSName(".");
-  rr.qtype=QType::NS;
-  rr.ttl=518400;
-  rr.d_place=DNSResourceRecord::AUTHORITY;
-  
-  for(char c='a';c<='m';++c) {
-    *templ=c;
-    rr.content=templ;
-    r->addRecord(rr);
-  }
-
-  if( d_sendRootReferral == LEAN_ROOT_REFERRAL )
-     return;
-
-  // add the additional stuff
-  
-  rr.ttl=3600000;
-  rr.qtype=QType::A;
-  rr.d_place=DNSResourceRecord::ADDITIONAL;
-
-  for(char c='a';c<='m';++c) {
-    *templ=c;
-    rr.qname=DNSName(templ);
-    rr.content=ips[c-'a'];
-    r->addRecord(rr);
-  }
-}
-
 /**
  * This adds CDNSKEY records to the answer packet. Returns true if one was added.
  *
@@ -1314,15 +1267,9 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse)
         return 0;
       }
       
-      if(!retargetcount)
+      if(!retargetcount) {
         r->setA(false); // drop AA if we never had a SOA in the first place
-      if( d_sendRootReferral != NO_ROOT_REFERRAL ) {
-        DLOG(L<<Logger::Warning<<"Adding root-referral"<<endl);
-        addRootReferral(r);
-      }
-      else {
-        if (!retargetcount)
-          r->setRcode(RCode::Refused); // send REFUSED - but only on empty 'no idea'
+        r->setRcode(RCode::Refused); // send REFUSED - but only on empty 'no idea'
       }
       goto sendit;
     }
index 5d6528ffd9406ba6e94619f8bc6a780959ba6de3..558c1942053ff539bb6a5c10f0bd8d9743e9be82 100644 (file)
 #
 # security-poll-suffix=secpoll.powerdns.com.
 
-#################################
-# send-root-referral   Send out old-fashioned root-referral instead of ServFail in case of no authority
-#
-# send-root-referral=no
-
 #################################
 # server-id    Returned when queried for 'server.id' TXT or NSID, defaults to hostname - disabled or custom
 #
index c6634e5c3a467606ab12808670d01e69d732bff0..03939b9adc7c1c41bb568b6a2ee022f5673a1aaa 100644 (file)
@@ -350,39 +350,6 @@ vector<uint8_t> makeEmptyQuery()
   return  packet;
 }
 
-
-vector<uint8_t> makeRootReferral()
-{
-  vector<uint8_t> packet;
-  DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::SOA);
-
-  // nobody reads what we output, but it appears to be the magic that shuts some nameservers up
-  static const char*ips[]={"198.41.0.4", "192.228.79.201", "192.33.4.12", "199.7.91.13", "192.203.230.10", "192.5.5.241", "192.112.36.4", "198.97.190.53", 
-                     "192.36.148.17","192.58.128.30", "193.0.14.129", "199.7.83.42", "202.12.27.33"};
-  static char templ[40];
-  strncpy(templ,"a.root-servers.net", sizeof(templ) - 1);
-  
-  
-  for(char c='a';c<='m';++c) {
-    *templ=c;
-    pw.startRecord(DNSName(), QType::NS, 3600, 1, DNSResourceRecord::AUTHORITY);
-    DNSRecordContent* drc = DNSRecordContent::mastermake(QType::NS, 1, templ);
-    drc->toPacket(pw);
-    delete drc;
-  }
-
-  for(char c='a';c<='m';++c) {
-    *templ=c;
-    pw.startRecord(DNSName(), QType::A, 3600, 1, DNSResourceRecord::ADDITIONAL);
-    DNSRecordContent* drc = DNSRecordContent::mastermake(QType::A, 1, ips[c-'a']);
-    drc->toPacket(pw);
-    delete drc;
-  }
-  pw.commit();
-  return  packet;
-
-}
-
 vector<uint8_t> makeTypicalReferral()
 {
   vector<uint8_t> packet;
@@ -413,22 +380,6 @@ vector<uint8_t> makeTypicalReferral()
   return  packet;
 }
 
-
-
-struct RootRefTest
-{
-  string getName() const
-  {
-    return "write rootreferral";
-  }
-
-  void operator()() const
-  {
-    vector<uint8_t> packet=makeRootReferral();
-  }
-
-};
-
 struct StackMallocTest
 {
   string getName() const
@@ -733,12 +684,6 @@ try
 
   doRun(StackMallocTest());
 
-  vector<uint8_t> packet = makeRootReferral();
-  doRun(ParsePacketBareTest(packet, "root-referral"));
-  doRun(ParsePacketTest(packet, "root-referral"));
-
-  doRun(RootRefTest());
-
   doRun(EmptyQueryTest());
   doRun(TypicalRefTest());
 
index 30848d37fccc332f619fdcd7c48d8ab357b8d7d8..ee6c32447dce81b43c7db02c9216c60a5d09c0fb 100755 (executable)
@@ -98,7 +98,7 @@ if daemon == 'authoritative':
         named_conf.write(AUTH_CONF_TPL)
 
     subprocess.check_call(["../pdns/pdnsutil", "--config-dir=.", "secure-zone", "powerdnssec.org"])
-    pdnscmd = ("../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ --no-shuffle --send-root-referral --dnsupdate=yes --cache-ttl=0 --config-dir=. --api=yes --webserver=yes --webserver-port="+WEBPORT+" --webserver-address=127.0.0.1 --webserver-password=something --api-key="+APIKEY).split()
+    pdnscmd = ("../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ --no-shuffle --dnsupdate=yes --cache-ttl=0 --config-dir=. --api=yes --webserver=yes --webserver-port="+WEBPORT+" --webserver-address=127.0.0.1 --webserver-password=something --api-key="+APIKEY).split()
 
 else:
     conf_dir = 'rec-conf.d'
index 1c2d5a5732bc66e4a2d615a2265d2755a375b66b..09720a08610f07c725e05dd6cc6b6ea4bf3c28ee 100755 (executable)
@@ -28,7 +28,7 @@ rm -f pdns*.pid
 
 $PDNS --daemon=no --local-port=$port --socket-dir=./          \
        --no-shuffle --launch=bind --bind-config=edns-packet-cache/named.conf   \
-       --send-root-referral --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
+       --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
 bindwait
        
 # prime cache without EDNS
index dcec1692b7cad2f3e4bd781eb608f15a6fa7454f..c49ffe118beedfa922f113daff97243bfe30a1a8 100755 (executable)
@@ -26,7 +26,7 @@ bindwait ()
 
 $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./          \
         --no-shuffle --launch=bind --bind-config=edns-packet-cache/named.conf   \
-        --send-root-referral --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
+        --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
 bindwait
 
 timeout 5 ./edns1/test-edns.py
index 927aea2f09293665962ae003074de70527de6265..595de0615476a2970c4ad46a1f28b453fa905584 100755 (executable)
@@ -29,7 +29,7 @@ rm -f pdns*.pid
 $PDNS --daemon=no --local-port=$port --socket-dir=./          \
        --no-shuffle --launch=bind --bind-config=lua-policy/named.conf   \
        --experimental-lua-policy-script=lua-policy/policy.lua \
-       --send-root-referral --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
+       --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
 bindwait
 
 # plain SOA query
index 9f1e91b5b9921a044a005ba138e05551eea8eef7..4ff317e169cabcb463bf22d12885257e266c00c1 100755 (executable)
@@ -10,7 +10,7 @@ rm -f pdns*.pid
 $PDNS --daemon=no --local-port=$port --socket-dir=./          \
        --no-shuffle --launch=bind,pipe --bind-config=negcache-tests-dotted-cname/named.conf   \
        --pipe-command=negcache-tests-dotted-cname/pipe.py \
-       --send-root-referral --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
+       --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
 
 sleep 3
 
index 9b53ddd7d1360b1956d84e403b01bad3eb4e7ed0..ab206c786d413e35d727899491acff1cb04c655f 100644 (file)
@@ -2,7 +2,6 @@ daemon=no
 local-port=5502
 socket-dir=./
 no-shuffle
-send-root-referral
 cache-ttl=0
 query-cache-ttl=0
 module-dir=../regression-tests/modules
index b8c23bb1cafb199295b09768fd68cc7be3fae274..5c88e5a2df54f773384a8a2200fafe5ed7c93fc3 100755 (executable)
@@ -84,7 +84,7 @@ start_master()
 {
         $RUNWRAPPER $PDNS --daemon=no --local-port=$port --config-dir=. --module-dir=../regression-tests/modules \
                 --config-name=gsqlite3-master --socket-dir=./ --no-shuffle \
-                --send-root-referral --master=yes --local-address=127.0.0.1 --local-ipv6='' \
+                --master=yes --local-address=127.0.0.1 --local-ipv6='' \
                 --query-local-address=127.0.0.1 --cache-ttl=$cachettl --dname-processing --allow-axfr-ips= &
 }
 
@@ -94,7 +94,7 @@ start_slave()
 
         $RUNWRAPPER $PDNS2 --daemon=no --local-port=$slaveport --config-dir=. --module-dir=../regression-tests/modules \
                 --config-name=gsqlite3-slave --socket-dir=./ --no-shuffle --local-address=127.0.0.2 --local-ipv6='' \
-                --send-root-referral --slave --retrieval-threads=4 --slave=yes --query-local-address=127.0.0.2 \
+                --slave --retrieval-threads=4 --slave=yes --query-local-address=127.0.0.2 \
                 --slave-cycle-interval=300 --allow-unsigned-notify=no --allow-unsigned-supermaster=no &
 }
 
index ed4551e660eac56fd105ca11cee805b45d321e12..1e9f0c7faa87a44b27734a5911d1e0a7e8d3ef9e 100755 (executable)
@@ -75,7 +75,7 @@ start_master()
 {
         $RUNWRAPPER $PDNS --daemon=no --local-port=$port --config-dir=. --module-dir=../regression-tests/modules \
                 --config-name=gsqlite3-master --socket-dir=./ --no-shuffle \
-                --send-root-referral --master=yes --local-address=127.0.0.1 --local-ipv6= \
+                --master=yes --local-address=127.0.0.1 --local-ipv6= \
                 --query-local-address=127.0.0.1 --cache-ttl=$cachettl --dname-processing --allow-axfr-ips= &
 }
 
@@ -85,7 +85,7 @@ start_slave()
 
         $RUNWRAPPER $PDNS2 --daemon=no --local-port=$slaveport --config-dir=. --module-dir=../regression-tests/modules \
                 --config-name=gsqlite3-slave --socket-dir=./ --no-shuffle --local-address=127.0.0.2 --local-ipv6= \
-                --send-root-referral --slave --retrieval-threads=4 --slave=yes --query-local-address=127.0.0.2 \
+                --slave --retrieval-threads=4 --slave=yes --query-local-address=127.0.0.2 \
                 --slave-cycle-interval=300 --dname-processing &
 }
 
index a9d1fcc5be175dc8fa756376298c52697c29bac2..d02e0372debf51043a39602f2e18a47d3c9d7ea8 100644 (file)
@@ -81,7 +81,7 @@ Run PowerDNS as (to test gmysql):
 ```
 $ ../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./  \
 --no-shuffle --launch=gmysql --gmysql-dbname=pdnstest --gmysql-user=root \
---fancy-records --query-logging --send-root-referral --loglevel=9 \
+--fancy-records --query-logging --loglevel=9 \
 --cache-ttl=0 --no-config
 ```
 
@@ -89,7 +89,7 @@ or (to test bind, without DNSSEC):
 ```
 $ ../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./  \
 --no-shuffle --launch=bind --bind-config=./named.conf                \
---fancy-records --query-logging --send-root-referral --loglevel=9    \
+--fancy-records --query-logging --loglevel=9    \
 --cache-ttl=0 --no-config
 ```
 
@@ -99,7 +99,7 @@ or (to test bind with DNSSEC):
 $ ./bind-dnssec-setup
 $ ../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./  \
 --no-shuffle --launch=bind --bind-config=./named.conf                \
---query-logging --send-root-referral --loglevel=9                    \
+--query-logging --loglevel=9                    \
 --cache-ttl=0 --no-config
 ```
 
@@ -115,7 +115,7 @@ echo 'analyze;' | sqlite3 powerdns.sqlite3
 $ ../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./  \
 --no-shuffle --launch=gsqlite3 \
 --gsqlite3-database=./powerdns.sqlite3 --gsqlite3-dnssec             \
---query-logging --send-root-referral --loglevel=9                    \
+--query-logging --loglevel=9                    \
 --cache-ttl=0 --no-config
 ```
 
index 5a370a729446d48fb49f08fa097d36df98fa4ba3..b6fe8c7770b215cdf93ec77ec157bb056a8d74c3 100755 (executable)
@@ -90,8 +90,7 @@ grep '^host' example.com | grep -e 'IN\s*A' | \
 
 $PDNS --daemon=no --local-port=$port --socket-dir=./ \
       --no-shuffle --launch=bind --bind-config=./named.conf \
-      --fancy-records --send-root-referral \
-      --cache-ttl=0 --no-config &
+      --fancy-records --cache-ttl=0 --no-config &
 bindwait
 
 DNSPERF=$DNSPERF port=$port ./add-zone/stress/dnsperf.sh &