From: Pieter Lexis Date: Tue, 15 Mar 2016 15:24:01 +0000 (+0100) Subject: Move the root server addresses to a single place X-Git-Tag: dnsdist-1.0.0-beta1~80^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10c9647516de9e4133a63fcdd081c44feb26da9c;p=pdns Move the root server addresses to a single place Also, update the L-root IPv6 Address Closes #3533 Closes #3534 --- diff --git a/pdns/recursordist/Makefile.am b/pdns/recursordist/Makefile.am index 4766ac726..3cf47f603 100644 --- a/pdns/recursordist/Makefile.am +++ b/pdns/recursordist/Makefile.am @@ -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 index 000000000..69985aebf --- /dev/null +++ b/pdns/recursordist/root-addresses.hh @@ -0,0 +1 @@ +../root-addresses.hh \ No newline at end of file diff --git a/pdns/reczones.cc b/pdns/reczones.cc index 8b99e23ec..43c7d8277 100644 --- a/pdns/reczones.cc +++ b/pdns/reczones.cc @@ -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 #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(DNSName(templ)); - arr.d_content=std::make_shared(ComboAddress(ips[c-'a'])); + arr.d_content=std::make_shared(ComboAddress(rootIps4[c-'a'])); vector aset; aset.push_back(arr); t_RC->replace(time(0), DNSName(templ), QType(QType::A), aset, vector>(), true); // auth, nuke it all - if (ip6s[c-'a'] != NULL) { - aaaarr.d_content=std::make_shared(ComboAddress(ip6s[c-'a'])); + if (rootIps6[c-'a'] != NULL) { + aaaarr.d_content=std::make_shared(ComboAddress(rootIps6[c-'a'])); vector aaaaset; aaaaset.push_back(aaaarr); diff --git a/pdns/root-addresses.hh b/pdns/root-addresses.hh new file mode 100644 index 000000000..1b84fc550 --- /dev/null +++ b/pdns/root-addresses.hh @@ -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. + };