]> granicus.if.org Git - pdns/commitdiff
Move the root server addresses to a single place
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 15 Mar 2016 15:24:01 +0000 (16:24 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 17 Mar 2016 09:10:47 +0000 (10:10 +0100)
Also, update the L-root IPv6 Address

Closes #3533
Closes #3534

pdns/recursordist/Makefile.am
pdns/recursordist/root-addresses.hh [new symlink]
pdns/reczones.cc
pdns/root-addresses.hh [new file with mode: 0644]

index 4766ac726fdc4dfd687f99291b37d5b43fb7d836..3cf47f603b80d74dd209d3fde990434882aed36c 100644 (file)
@@ -107,6 +107,7 @@ pdns_recursor_SOURCES = \
        reczones.cc \
        resolver.hh resolver.cc \
        responsestats.hh responsestats.cc \
+       root-addresses.hh \
        rpzloader.cc rpzloader.hh \
        secpoll-recursor.cc \
        secpoll-recursor.hh \
diff --git a/pdns/recursordist/root-addresses.hh b/pdns/recursordist/root-addresses.hh
new file mode 120000 (symlink)
index 0000000..69985ae
--- /dev/null
@@ -0,0 +1 @@
+../root-addresses.hh
\ No newline at end of file
index 8b99e23ec796a6ee1a8dad197b0e501f570d8227..43c7d8277e120251f986af47b67a0112fe8df62a 100644 (file)
@@ -1,6 +1,6 @@
 /*
     PowerDNS Versatile Database Driven Nameserver
-    Copyright (C) 2003 - 2010  PowerDNS.COM BV
+    Copyright (C) 2003 - 2016  PowerDNS.COM BV
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 
@@ -32,6 +32,7 @@
 #include <thread>
 #include "ixfr.hh"
 #include "rpzloader.hh"
+#include "root-addresses.hh"
 
 extern int g_argc;
 extern char** g_argv;
@@ -44,15 +45,6 @@ void primeHints(void)
     t_RC = new MemRecursorCache();
 
   if(::arg()["hint-file"].empty()) {
-    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 const char *ip6s[]={
-      "2001:503:ba3e::2:30", "2001:500:84::b", "2001:500:2::c", "2001:500:2d::d", NULL,
-      "2001:500:2f::f", NULL, "2001:500:1::53", "2001:7fe::53",
-      "2001:503:c27::2:30", "2001:7fd::1", "2001:500:3::42", "2001:dc3::35"
-    };
-    
     DNSRecord arr, aaaarr, nsrr;
     nsrr.d_name=DNSName(".");
     arr.d_type=QType::A;
@@ -66,12 +58,12 @@ void primeHints(void)
       *templ=c;
       aaaarr.d_name=arr.d_name=DNSName(templ);
       nsrr.d_content=std::make_shared<NSRecordContent>(DNSName(templ));
-      arr.d_content=std::make_shared<ARecordContent>(ComboAddress(ips[c-'a']));
+      arr.d_content=std::make_shared<ARecordContent>(ComboAddress(rootIps4[c-'a']));
       vector<DNSRecord> aset;
       aset.push_back(arr);
       t_RC->replace(time(0), DNSName(templ), QType(QType::A), aset, vector<std::shared_ptr<RRSIGRecordContent>>(), true); // auth, nuke it all
-      if (ip6s[c-'a'] != NULL) {
-        aaaarr.d_content=std::make_shared<AAAARecordContent>(ComboAddress(ip6s[c-'a']));
+      if (rootIps6[c-'a'] != NULL) {
+        aaaarr.d_content=std::make_shared<AAAARecordContent>(ComboAddress(rootIps6[c-'a']));
 
         vector<DNSRecord> aaaaset;
         aaaaset.push_back(aaaarr);
diff --git a/pdns/root-addresses.hh b/pdns/root-addresses.hh
new file mode 100644 (file)
index 0000000..1b84fc5
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+    PowerDNS Versatile Database Driven Nameserver
+    Copyright (C) 2002 - 2016 PowerDNS.COM BV
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License version 2
+    as published by the Free Software Foundation
+
+    Additionally, the license of this program contains a special
+    exception which allows to distribute the program in binary form when
+    it is linked against OpenSSL.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#pragma once
+
+static const char*rootIps4[]={"198.41.0.4",             // a.root-servers.net.
+                              "192.228.79.201",         // b.root-servers.net.
+                              "192.33.4.12",            // c.root-servers.net.
+                              "199.7.91.13",            // d.root-servers.net.
+                              "192.203.230.10",         // e.root-servers.net.
+                              "192.5.5.241",            // f.root-servers.net.
+                              "192.112.36.4",           // g.root-servers.net.
+                              "198.97.190.53",          // h.root-servers.net.
+                              "192.36.148.17",          // i.root-servers.net.
+                              "192.58.128.30",          // j.root-servers.net.
+                              "193.0.14.129",           // k.root-servers.net.
+                              "199.7.83.42",            // l.root-servers.net.
+                              "202.12.27.33"            // m.root-servers.net.
+                              };
+
+static const char*rootIps6[]={"2001:503:ba3e::2:30",    // a.root-servers.net.
+                              "2001:500:84::b",         // b.root-servers.net.
+                              "2001:500:2::c",          // c.root-servers.net.
+                              "2001:500:2d::d",         // d.root-servers.net.
+                              NULL,                     // e.root-servers.net.
+                              "2001:500:2f::f",         // f.root-servers.net.
+                              NULL,                     // g.root-servers.net.
+                              "2001:500:1::53",         // h.root-servers.net.
+                              "2001:7fe::53",           // i.root-servers.net.
+                              "2001:503:c27::2:30",     // j.root-servers.net.
+                              "2001:7fd::1",            // k.root-servers.net.
+                              "2001:500:9f::42",        // l.root-servers.net.
+                              "2001:dc3::35"            // m.root-servers.net.
+                              };