]> granicus.if.org Git - pdns/commitdiff
implement DNAME. Probably some rough edges.
authorbert hubert <bert.hubert@netherlabs.nl>
Mon, 7 Apr 2014 15:04:12 +0000 (17:04 +0200)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Fri, 11 Apr 2014 17:25:40 +0000 (17:25 +0000)
38 files changed:
modules/tinydnsbackend/data
modules/tinydnsbackend/data.cdb
pdns/common_startup.cc
pdns/dnsrecords.cc
pdns/dnsrecords.hh
pdns/packethandler.cc
pdns/packethandler.hh
pdns/pdns.conf-dist
pdns/qtype.hh
pdns/zoneparser-tng.cc
regression-tests.nobackend/tinydns-data-check/expected_result
regression-tests/backends/bind-master
regression-tests/backends/bind-slave
regression-tests/backends/gmysql-master
regression-tests/backends/gmysql-slave
regression-tests/backends/gpgsql-master
regression-tests/backends/gsqlite3-master
regression-tests/backends/gsqlite3-slave
regression-tests/backends/mydns-master
regression-tests/backends/opendbx-master
regression-tests/backends/remote-master
regression-tests/backends/tinydns-master
regression-tests/tests/dname-self/command [new file with mode: 0755]
regression-tests/tests/dname-self/description [new file with mode: 0644]
regression-tests/tests/dname-self/expected_result [new file with mode: 0644]
regression-tests/tests/dname-self/skip-unboundhost [new file with mode: 0644]
regression-tests/tests/dname-self/skip.mydns [new file with mode: 0644]
regression-tests/tests/dname-self/skip.nodnssec [new file with mode: 0644]
regression-tests/tests/dname/command [new file with mode: 0755]
regression-tests/tests/dname/description [new file with mode: 0644]
regression-tests/tests/dname/expected_result [new file with mode: 0644]
regression-tests/tests/dname/skip-unboundhost [new file with mode: 0644]
regression-tests/tests/dname/skip.mydns [new file with mode: 0644]
regression-tests/tests/dname/skip.nodnssec [new file with mode: 0644]
regression-tests/tests/ent-axfr/expected_result
regression-tests/tests/ent-axfr/expected_result.nsec3
regression-tests/tests/ent-axfr/expected_result.nsec3-optout
regression-tests/zones/test.com

index 403966b6ea890b3fedd090bcc928cc964f3cc7b0..26098dbd2541c59ebd4d463a29c0e8e9369b2e61 100644 (file)
@@ -20017,7 +20017,7 @@ Cexternal.example.com:somewhere.else.net.:120
 +host-9998.example.com:192.168.1.14:120
 +host-9999.example.com:192.168.1.15:120
 :hwinfo.example.com:13:\003abc\003def:120
-:ipv6.example.com:28:\040\001\006\250\000\000\000\001\002\020K\377\376KLa:120
+3ipv6.example.com:200106a80000000102104bfffe4b4c61:120
 &italy.example.com::italy-ns1.example.com.:120
 &italy.example.com::italy-ns2.example.com.:120
 +italy-ns1.example.com:192.168.5.1:120
@@ -20154,6 +20154,7 @@ Ztest.com:ns1.test.com.:ahu.example.com.:2005092501:28800:7200:604800:86400:3600
 +b.c.test.com:5.6.7.8:3600
 +\052.a.b.c.test.com:8.7.6.5:3600
 +counter.test.com:1.1.1.5:3600
+:d.test.com:39:\002d2\005test2\003com\000:3600
 :_double._tcp.dc.test.com:33:\000\000\000d\001\205\007server1\004test\003com\000:3600
 :_double._tcp.dc.test.com:33:\000\001\000d\001\205\007server1\004test\003com\000:3600
 :_ldap._tcp.dc.test.com:33:\000\000\000d\001\205\007server2\007example\003net\000:3600
index 916e491a575051833a450b76a45ed69ab4ab4ce6..8f8658c923f8c8974058972bbfdbf55f81afad75 100644 (file)
Binary files a/modules/tinydnsbackend/data.cdb and b/modules/tinydnsbackend/data.cdb differ
index ffa1cce6b0826c4bde78286468636fab60a82eaa..eb8cd0db2ab86a2cb4599a715eff59594bd60010 100644 (file)
@@ -65,6 +65,7 @@ void declareArguments()
   ::arg().set("retrieval-threads", "Number of AXFR-retrieval threads for slave operation")="2";
   ::arg().setSwitch("experimental-json-interface", "If the webserver should serve JSON data")="no";
   ::arg().setSwitch("experimental-api-readonly", "If the JSON API should disallow data modification")="no";
+  ::arg().setSwitch("experimental-dname-processing", "If we should support DNAME records")="no";
 
   ::arg().setCmd("help","Provide a helpful message");
   ::arg().setCmd("version","Output version and compilation date");
@@ -349,6 +350,7 @@ void mainthread()
    
    g_anyToTcp = ::arg().mustDo("any-to-tcp");
    g_addSuperfluousNSEC3 = ::arg().mustDo("add-superfluous-nsec3-for-old-bind");
+
    DNSPacket::s_udpTruncationThreshold = std::max(512, ::arg().asNum("udp-truncation-threshold"));
    DNSPacket::s_doEDNSSubnetProcessing = ::arg().mustDo("edns-subnet-processing");
    {
index 798db95e2b1dbcf40b2b6a18d0548101734d0dde..85ce9c4016c10ad17b02183fa45f2b5f57d32e2a 100644 (file)
@@ -119,6 +119,7 @@ boilerplate_conv(AAAA, ns_t_aaaa, conv.xfrIP6(d_ip6); );
 boilerplate_conv(NS, ns_t_ns, conv.xfrLabel(d_content, true));
 boilerplate_conv(PTR, ns_t_ptr, conv.xfrLabel(d_content, true));
 boilerplate_conv(CNAME, ns_t_cname, conv.xfrLabel(d_content, true));
+boilerplate_conv(DNAME, ns_t_dname, conv.xfrLabel(d_content));
 boilerplate_conv(MR, ns_t_mr, conv.xfrLabel(d_alias, true));
 boilerplate_conv(MINFO, ns_t_minfo, conv.xfrLabel(d_rmailbx, true); conv.xfrLabel(d_emailbx, true));
 boilerplate_conv(TXT, ns_t_txt, conv.xfrText(d_text, true));
@@ -493,6 +494,7 @@ void reportBasicTypes()
 void reportOtherTypes()
 {
    AFSDBRecordContent::report();
+   DNAMERecordContent::report();
    SPFRecordContent::report();
    NAPTRRecordContent::report();
    LOCRecordContent::report();
index 59dc0a9c6a4324af58c7d470ee823ee1352d5945..fd2197cc8826bf2ac42a9c9cceff457018b0db52 100644 (file)
@@ -201,6 +201,16 @@ private:
   string d_content;
 };
 
+class DNAMERecordContent : public DNSRecordContent
+{
+public:
+  includeboilerplate(DNAME)
+
+private:
+  string d_content;
+};
+
+
 class MRRecordContent : public DNSRecordContent
 {
 public:
index d923d7c2822a728bb4eaf75aeeb66942630aadfc..698c764d00fd8b81c4ea681479da1f58431c1f92 100644 (file)
@@ -1,6 +1,6 @@
 /*
     PowerDNS Versatile Database Driven Nameserver
-    Copyright (C) 2002-2012  PowerDNS.COM BV
+    Copyright (C) 2002-2014  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 
@@ -62,6 +62,7 @@ PacketHandler::PacketHandler():B(s_programname)
 {
   ++s_count;
   d_doFancyRecords = (::arg()["fancy-records"]!="no");
+  d_doDNAME=::arg().mustDo("experimental-dname-processing");
   d_doRecursion= ::arg().mustDo("recursor");
   d_logDNSDetails= ::arg().mustDo("log-dns-details");
   d_doIPv6AdditionalProcessing = ::arg().mustDo("do-ipv6-additional-processing");
@@ -331,6 +332,37 @@ vector<DNSResourceRecord> PacketHandler::getBestReferralNS(DNSPacket *p, SOAData
   return ret;
 }
 
+vector<DNSResourceRecord> PacketHandler::getBestDNAMESynth(DNSPacket *p, SOAData& sd, string &target)
+{
+  vector<DNSResourceRecord> ret;
+  DNSResourceRecord rr;
+  string prefix;
+  string subdomain(target);
+  do {
+    DLOG(L<<"Attempting DNAME lookup for "<<subdomain<<", sd.qname="<<sd.qname<<endl);
+
+    B.lookup(QType(QType::DNAME), subdomain, p, sd.domain_id);
+    while(B.get(rr)) {
+      ret.push_back(rr);  // put in the original
+      rr.qtype = QType::CNAME;
+      rr.qname = prefix + rr.qname;
+      rr.content = prefix + rr.content;
+      target= rr.content;
+      ret.push_back(rr); 
+    }
+    if(!ret.empty())
+      return ret;
+    string::size_type pos = subdomain.find('.');
+    if(pos != string::npos)
+      prefix+= subdomain.substr(0, pos+1);
+    if(subdomain == sd.qname) // stop at SOA
+      break;
+
+  } while( chopOff( subdomain ) );   // 'www.powerdns.org' -> 'powerdns.org' -> 'org' -> ''
+  return ret;
+}
+
+
 // Return best matching wildcard or next closer name
 bool PacketHandler::getBestWildcard(DNSPacket *p, SOAData& sd, const string &target, string &wildcard, vector<DNSResourceRecord>* ret)
 {
@@ -1070,6 +1102,21 @@ void PacketHandler::completeANYRecords(DNSPacket *p, DNSPacket*r, SOAData& sd, c
   }
 }
 
+bool PacketHandler::tryDNAME(DNSPacket *p, DNSPacket*r, SOAData& sd, string &target)
+{
+  if(!d_doDNAME)
+    return false;
+  DLOG(L<<Logger::Warning<<"Let's try DNAME.."<<endl);
+  vector<DNSResourceRecord> rrset = getBestDNAMESynth(p, sd, target);
+  if(!rrset.empty()) {
+    BOOST_FOREACH(DNSResourceRecord& rr, rrset) {
+      rr.d_place = DNSResourceRecord::ANSWER;
+      r->addRecord(rr);
+    }
+    return true;
+  }
+  return false;
+}
 bool PacketHandler::tryWildcard(DNSPacket *p, DNSPacket*r, SOAData& sd, string &target, string &wildcard, bool& retargeted, bool& nodata)
 {
   retargeted = nodata = false;
@@ -1199,7 +1246,6 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse)
       return r;
     }
 
-
     string target=p->qdomain;
 
     // catch chaos qclass requests
@@ -1312,7 +1358,7 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse)
     // see what we get..
     B.lookup(QType(QType::ANY), target, p, sd.domain_id);
     rrset.clear();
-    weDone = weRedirected = weHaveUnauth = 0;
+    weDone = weRedirected = weHaveUnauth =  false;
     
     while(B.get(rr)) {
       if (p->qtype.getCode() == QType::ANY) {
@@ -1350,6 +1396,7 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse)
         rrset.push_back(rr);
     }
 
+
     DLOG(L<<"After first ANY query for '"<<target<<"', id="<<sd.domain_id<<": weDone="<<weDone<<", weHaveUnauth="<<weHaveUnauth<<", weRedirected="<<weRedirected<<endl);
     if(p->qtype.getCode() == QType::DS && weHaveUnauth &&  !weDone && !weRedirected && d_dk.isSecuredZone(sd.qname)) {
       DLOG(L<<"Q for DS of a name for which we do have NS, but for which we don't have on a zone with DNSSEC need to provide an AUTH answer that proves we don't"<<endl);
@@ -1369,6 +1416,7 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse)
         }
       }
 
+      
       DLOG(L<<Logger::Warning<<"Found nothing in the by-name ANY, but let's try wildcards.."<<endl);
       bool wereRetargeted(false), nodata(false);
       string wildcard;
@@ -1382,6 +1430,10 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse)
 
         goto sendit;
       }
+      else if(tryDNAME(p, r, sd, target)) {
+       retargetcount++;
+       goto retargeted;
+      }
       else
       {        
         if (!(((p->qtype.getCode() == QType::CNAME) || (p->qtype.getCode() == QType::ANY)) && retargetcount > 0))
index c182ef31ff9d618a0c74b13a2a22d3d2054cf0fa..630f4d939db07c3060baf89f26aee7f2464449ee 100644 (file)
@@ -95,6 +95,8 @@ private:
   void makeNXDomain(DNSPacket* p, DNSPacket* r, const std::string& target, const std::string& wildcard, SOAData& sd);
   void makeNOError(DNSPacket* p, DNSPacket* r, const std::string& target, const std::string& wildcard, SOAData& sd, int mode);
   vector<DNSResourceRecord> getBestReferralNS(DNSPacket *p, SOAData& sd, const string &target);
+  vector<DNSResourceRecord> getBestDNAMESynth(DNSPacket *p, SOAData& sd, string &target);
+  bool tryDNAME(DNSPacket *p, DNSPacket*r, SOAData& sd, string &target);
   bool tryReferral(DNSPacket *p, DNSPacket*r, SOAData& sd, const string &target);
 
   bool getBestWildcard(DNSPacket *p, SOAData& sd, const string &target, string &wildcard, vector<DNSResourceRecord>* ret);
@@ -108,6 +110,7 @@ private:
   bool d_doRecursion;
   bool d_logDNSDetails;
   bool d_doIPv6AdditionalProcessing;
+  bool d_doDNAME;
   int d_sendRootReferral;
   AuthLua* d_pdl;
 
index e5564835a3bf71a32fd600b0019fa4f61d3b6a43..a41c136c2e58b8d80880396a67d702735df644ee 100644 (file)
 #
 # experimental-api-readonly=no
 
+#################################
+# experimental-dname-processing        If we should support DNAME records
+#
+# experimental-dname-processing=no
+
 #################################
 # experimental-json-interface  If the webserver should serve JSON data
 #
index f959dd9e652e952c40a826ae50f3118715ae1067..ba83eb298e900fdf678714a6aa3d8526bdc3b723 100644 (file)
@@ -81,7 +81,7 @@ public:
 // more solaris fun
 #undef DS
   enum typeenum {A=1, NS=2, CNAME=5, SOA=6, MR=9, PTR=12, HINFO=13, MX=15, TXT=16, RP=17, AFSDB=18, SIG=24, KEY=25, AAAA=28, LOC=29, SRV=33, NAPTR=35, KX=36,
-     CERT=37, A6=38, OPT=41, DS=43, SSHFP=44, IPSECKEY=45, RRSIG=46, NSEC=47, DNSKEY=48, DHCID=49, NSEC3=50, NSEC3PARAM=51,
+                CERT=37, A6=38, DNAME=39, OPT=41, DS=43, SSHFP=44, IPSECKEY=45, RRSIG=46, NSEC=47, DNSKEY=48, DHCID=49, NSEC3=50, NSEC3PARAM=51,
      TLSA=52, SPF=99, EUI48=108, EUI64=109, TSIG=250, IXFR=251, AXFR=252, MAILB=253, MAILA=254, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259, DLV=32769} types;
   typedef pair<string,uint16_t> namenum;
   static vector<namenum> names;
@@ -141,6 +141,7 @@ private:
       qtype_insert("KX", 36);
       qtype_insert("CERT", 37);
       qtype_insert("A6", 38);
+      qtype_insert("DNAME", 39);
       qtype_insert("OPT", 41);
       qtype_insert("DS", 43);
       qtype_insert("SSHFP", 44);
index 0d9022877d6b91800d3928dc6c1dee4dc64cffe3..c241e90f67386825e21cfa2d1617989c021c3786 100644 (file)
@@ -401,6 +401,7 @@ bool ZoneParserTNG::get(DNSResourceRecord& rr)
     
   case QType::NS:
   case QType::CNAME:
+  case QType::DNAME:
   case QType::PTR:
   case QType::AFSDB:
     rr.content=stripDot(toCanonic(d_zonename, rr.content));
index 894b69837cd16c3351ad796eab0aed9fbcd6f91d..36c5fbb4e08d623bb77ef2773961351e1751b208 100644 (file)
@@ -1,5 +1,5 @@
 4bc48a8d9b8d04b553be67639e5656e8  ../regression-tests/zones/example.com
-4e9eed426f0cd123c08dffb9e715824a  ../regression-tests/zones/test.com
+38f421f6dd6c842f6f4f8a5a996cdb7d  ../regression-tests/zones/test.com
 005b3381db2a7dc70b690484f6ab7770  ../regression-tests/zones/test.dyndns
 21213b4e8cd56e4184696a1bafd987d7  ../regression-tests/zones/wtest.com
 42b442de632686e94bde75acf66cf524  ../regression-tests/zones/nztest.com
@@ -9,4 +9,4 @@ a63dc120391d9df0003f2ec4f461a6af  ../regression-tests/zones/secure-delegated.dns
 24514dc104b22206daeb973ff9303545  ../regression-tests/zones/minimal.com
 0b20d7a0250576451135483b863750bf  ../regression-tests/zones/tsig.com
 b1f775045fa2cf0a3b91aa834af06e49  ../regression-tests/zones/stest.com
-a691ba21cde91f1b9f3cc92c7a078636  ../modules/tinydnsbackend/data.cdb
+11085cc884e2db8bbd5a4710aad23604  ../modules/tinydnsbackend/data.cdb
index 38acff18e01e315e9142c2d63bd6bd113c7e5d94..f5a061309dbf487273d76a6a495516c555357fe5 100644 (file)
@@ -4,7 +4,7 @@ case $context in
                        --no-shuffle --launch=bind --bind-config=./named.conf \
                        --send-root-referral \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
-                       --cache-ttl=$cachettl --no-config \
+                       --cache-ttl=$cachettl --no-config --experimental-dname-processing \
                        --bind-ignore-broken-records=yes &
                skipreasons="nodnssec nodyndns nometa"
                bindwait
@@ -51,7 +51,7 @@ case $context in
                        --bind-dnssec-db=./dnssec.sqlite3 \
                        --send-root-referral \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes --direct-dnskey=yes \
-                       --cache-ttl=$cachettl --no-config \
+                       --cache-ttl=$cachettl --no-config --experimental-dname-processing \
                        --bind-ignore-broken-records=yes $lua_prequery &
                bindwait
                ;;
index 0ddd001347f58c1a28d4a3792d21981e74751820..28b224792a538a90a976840d27a6c30fed423b0c 100644 (file)
@@ -30,6 +30,6 @@
                --no-shuffle --launch=bind --bind-config=./named-slave.conf --slave \
                --send-root-referral --retrieval-threads=1  --config-name=bind-slave \
                --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
-               --cache-ttl=$cachettl --no-config --bind-dnssec-db=./dnssec-slave.sqlite3 &
+               --cache-ttl=$cachettl --no-config --experimental-dname-processing --bind-dnssec-db=./dnssec-slave.sqlite3 &
        echo 'waiting for zones to be loaded'
        bindwait bind-slave
index e971274ebcbda39bae593461808179b9735ecb44..70581bb6153ccb70d646cee2342e255b541b2b6b 100644 (file)
@@ -35,7 +35,7 @@ __EOF__
                        --no-shuffle --launch=gmysql \
                        --master --send-root-referral \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes --direct-dnskey=yes \
-                       --cache-ttl=$cachettl --no-config \
+                       --cache-ttl=$cachettl --experimental-dname-processing --no-config \
                        --gmysql-dbname="$GMYSQLDB" \
                        --gmysql-user="$GMYSQLUSER" \
                        --gmysql-host="$GMYSQLHOST" \
@@ -87,7 +87,7 @@ __EOF__
                        --no-shuffle --launch --launch+=random --launch+=gmysql --launch+=random --gmysql-dnssec \
                        --send-root-referral \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes --direct-dnskey=yes \
-                       --cache-ttl=$cachettl --no-config \
+                       --cache-ttl=$cachettl --experimental-dname-processing --no-config \
                        --gmysql-dbname="$GMYSQLDB" \
                        --gmysql-user="$GMYSQLUSER" \
                        --gmysql-host="$GMYSQLHOST" \
index 39646d143c666c21c9462f7793b18d6c826553da..3af5c7e2f2a7ef32b2e97fd283975a92f80453e6 100644 (file)
@@ -36,7 +36,7 @@
                --no-shuffle --launch=gmysql --gmysql-dnssec \
                --send-root-referral \
                --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
-               --cache-ttl=$cachettl --query-cache-ttl=$cachettl --no-config --slave --retrieval-threads=4 \
+               --cache-ttl=$cachettl --query-cache-ttl=$cachettl --experimental-dname-processing --no-config --slave --retrieval-threads=4 \
                --gmysql-dbname="$GMYSQL2DB" \
                --gmysql-user="$GMYSQL2USER" \
                --gmysql-host="$GMYSQL2HOST" \
index 23231af541289421ec7680838f1bf86111b1f8bb..d62eac45b1192723f01fcf6c7580480237c7d86b 100644 (file)
@@ -27,7 +27,7 @@ __EOF__
                        --no-shuffle --launch=gpgsql \
                        --send-root-referral \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
-                       --cache-ttl=$cachettl --no-config \
+                       --cache-ttl=$cachettl --experimental-dname-processing --no-config \
                        --gpgsql-dbname="$GPGSQLDB" \
                        --gpgsql-user="$GPGSQLUSER" &
                skipreasons="nodnssec nodyndns"
@@ -67,7 +67,7 @@ __EOF__
                        --no-shuffle --launch=gpgsql --gpgsql-dnssec \
                        --send-root-referral \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
-                       --cache-ttl=$cachettl --no-config \
+                       --cache-ttl=$cachettl --experimental-dname-processing --no-config \
                        --gpgsql-dbname="$GPGSQLDB" \
                        --gpgsql-user="$GPGSQLUSER" $lua_prequery &
                if [ $context = gpgsql-nsec3 ]
index f98ab6d47d8915e7473c25c03c79735d30b1d348..1f709894b1694c02ea3d817e51a41860f134f41f 100644 (file)
@@ -21,7 +21,7 @@ __EOF__
                        --no-shuffle --launch=gsqlite3 \
                        --send-root-referral \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
-                       --cache-ttl=$cachettl --no-config \
+                       --cache-ttl=$cachettl --experimental-dname-processing --no-config \
                        --gsqlite3-database=pdns.sqlite3 &
                skipreasons="nodnssec nodyndns"
                ;;
@@ -54,7 +54,7 @@ __EOF__
                        --no-shuffle --launch=gsqlite3 --gsqlite3-dnssec \
                        --send-root-referral \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
-                       --cache-ttl=$cachettl --no-config \
+                       --cache-ttl=$cachettl --experimental-dname-processing --no-config \
                        --gsqlite3-database=pdns.sqlite3 $lua_prequery &
                if [ $context = gsqlite3-nsec3 ]
                then
index 162ef33c8a82ec10375e5aec9e97bb19868f2529..ec80b662c3cc12313acb563fde631cfb9c7c3d55 100644 (file)
@@ -22,7 +22,7 @@
        $RUNWRAPPER $PDNS2 --daemon=no --local-port=$port --socket-dir=./  \
                --no-shuffle --launch=gsqlite3 --gsqlite3-dnssec \
                --fancy-records --send-root-referral \
-               --cache-ttl=0 --query-cache-ttl=0 --no-config --slave --retrieval-threads=4 \
+               --cache-ttl=0 --query-cache-ttl=0 --experimental-dname-processing --no-config --slave --retrieval-threads=4 \
                --gsqlite3-database=pdns.sqlite31 --gsqlite3-pragma-synchronous=0 \
                --config-name=gsqlite32 &
        echo 'waiting for zones to be slaved'
index e45490591e0fd43671eaa393c9f8ad45d90a74ab..9eda2866c7a566045c93fea68bd3e2ed33e14769 100644 (file)
@@ -24,7 +24,7 @@ __EOF__
                $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./  \
                        --no-shuffle --launch=mydns \
                        --master --send-root-referral \
-                       --cache-ttl=0 --no-config \
+                       --cache-ttl=0 --experimental-dname-processing --no-config \
                        --mydns-rr-active=no --mydns-soa-active=no --mydns-use-minimal-ttl=no \
                        --mydns-dbname="$MYDNSDB" \
                        --mydns-user="$MYDNSUSER" \
index be04f67210e4bf6f5017dd733482ca67e88c1841..79046ab088d23e587e96e55b15d12251fef3d781 100644 (file)
@@ -10,7 +10,7 @@ case $context in
                $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./  \
                        --no-shuffle --launch=opendbx \
                        --send-root-referral \
-                       --cache-ttl=$cachettl --no-config \
+                       --cache-ttl=$cachettl --experimental-dname-processing --no-config \
                        --opendbx-backend=sqlite3 --opendbx-host-read=./ --opendbx-host-write=./ \
                        --opendbx-database=pdns-opendbx.sqlite3 &
                skipreasons="nodnssec noent nodyndns nometa"
index d270ab33b5173fc5c59ca4c4bf50e947ee7cb75e..9d9fb81f6a52abaeb5d077e25ffe91003f105ff2 100644 (file)
@@ -106,7 +106,7 @@ EOF
 
                $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./ \
                        --no-shuffle --launch=remote \
-                       --query-logging --loglevel=9 --cache-ttl=$cachettl --no-config \
+                       --query-logging --loglevel=9 --cache-ttl=$cachettl --experimental-dname-processing --no-config \
                        --send-root-referral --distributor-threads=1 \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
                        --remote-connection-string="$connstr" $remote_add_param &
index 20e34bd3015e9b989f23538fd96745efcb8fa4e3..be883d564099ed62dbb1329f654ebad6be275f20 100644 (file)
@@ -2,7 +2,7 @@ case $context in
        tinydns)
                $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./ \
                        --no-shuffle --launch=tinydns \
-                --cache-ttl=$cachettl --no-config \
+                --cache-ttl=$cachettl --experimental-dname-processing --no-config \
                        --send-root-referral \
                        --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
                        --tinydns-dbfile=../modules/tinydnsbackend/data.cdb & 
diff --git a/regression-tests/tests/dname-self/command b/regression-tests/tests/dname-self/command
new file mode 100755 (executable)
index 0000000..146bde5
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+cleandig d.test.com A
diff --git a/regression-tests/tests/dname-self/description b/regression-tests/tests/dname-self/description
new file mode 100644 (file)
index 0000000..7c6b6eb
--- /dev/null
@@ -0,0 +1 @@
+Make sure a DNAME does not synthesise for its own owner name.
diff --git a/regression-tests/tests/dname-self/expected_result b/regression-tests/tests/dname-self/expected_result
new file mode 100644 (file)
index 0000000..4c9dd54
--- /dev/null
@@ -0,0 +1,3 @@
+1      test.com.       IN      SOA     3600    ns1.test.com. ahu.example.com. 2005092501 28800 7200 604800 86400
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='d.test.com.', qtype=A
diff --git a/regression-tests/tests/dname-self/skip-unboundhost b/regression-tests/tests/dname-self/skip-unboundhost
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regression-tests/tests/dname-self/skip.mydns b/regression-tests/tests/dname-self/skip.mydns
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regression-tests/tests/dname-self/skip.nodnssec b/regression-tests/tests/dname-self/skip.nodnssec
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regression-tests/tests/dname/command b/regression-tests/tests/dname/command
new file mode 100755 (executable)
index 0000000..1dc9147
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+cleandig www.d.test.com A
diff --git a/regression-tests/tests/dname/description b/regression-tests/tests/dname/description
new file mode 100644 (file)
index 0000000..904accf
--- /dev/null
@@ -0,0 +1 @@
+Check that we synthesise a CNAME from a DNAME.
diff --git a/regression-tests/tests/dname/expected_result b/regression-tests/tests/dname/expected_result
new file mode 100644 (file)
index 0000000..3490552
--- /dev/null
@@ -0,0 +1,29 @@
+0      d.test.com.     IN      DNAME   3600    d2.test2.com.
+0      www.d.test.com. IN      CNAME   3600    www.d2.test2.com.
+1      .       IN      NS      518400  a.root-servers.net.
+1      .       IN      NS      518400  b.root-servers.net.
+1      .       IN      NS      518400  c.root-servers.net.
+1      .       IN      NS      518400  d.root-servers.net.
+1      .       IN      NS      518400  e.root-servers.net.
+1      .       IN      NS      518400  f.root-servers.net.
+1      .       IN      NS      518400  g.root-servers.net.
+1      .       IN      NS      518400  h.root-servers.net.
+1      .       IN      NS      518400  i.root-servers.net.
+1      .       IN      NS      518400  j.root-servers.net.
+1      .       IN      NS      518400  k.root-servers.net.
+1      .       IN      NS      518400  l.root-servers.net.
+1      .       IN      NS      518400  m.root-servers.net.
+2      a.root-servers.net.     IN      A       3600000 198.41.0.4
+2      b.root-servers.net.     IN      A       3600000 192.228.79.201
+2      c.root-servers.net.     IN      A       3600000 192.33.4.12
+2      d.root-servers.net.     IN      A       3600000 199.7.91.13
+2      e.root-servers.net.     IN      A       3600000 192.203.230.10
+2      f.root-servers.net.     IN      A       3600000 192.5.5.241
+2      g.root-servers.net.     IN      A       3600000 192.112.36.4
+2      h.root-servers.net.     IN      A       3600000 128.63.2.53
+2      i.root-servers.net.     IN      A       3600000 192.36.148.17
+2      j.root-servers.net.     IN      A       3600000 192.58.128.30
+2      k.root-servers.net.     IN      A       3600000 193.0.14.129
+2      l.root-servers.net.     IN      A       3600000 199.7.83.42
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='www.d.test.com.', qtype=A
diff --git a/regression-tests/tests/dname/skip-unboundhost b/regression-tests/tests/dname/skip-unboundhost
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regression-tests/tests/dname/skip.mydns b/regression-tests/tests/dname/skip.mydns
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regression-tests/tests/dname/skip.nodnssec b/regression-tests/tests/dname/skip.nodnssec
new file mode 100644 (file)
index 0000000..e69de29
index 05ab7f2e5f5806b94a372f50b9ab887b50035671..6d584c4f1cd9d5bc7c66717f6c1f175dcc8a2041 100644 (file)
@@ -7,7 +7,8 @@ _underscore.test.com.   IN      NSEC    86400   aland.test.com. TXT RRSIG NSEC
 aland.test.com.        IN      NSEC    86400   blah.test.com. TXT RRSIG NSEC
 b.c.test.com.  IN      NSEC    86400   *.a.b.c.test.com. A RRSIG NSEC
 blah.test.com. IN      NSEC    86400   b.c.test.com. NS RRSIG NSEC
-counter.test.com.      IN      NSEC    86400   _double._tcp.dc.test.com. A RRSIG NSEC
+counter.test.com.      IN      NSEC    86400   d.test.com. A RRSIG NSEC
+d.test.com.    IN      NSEC    86400   _double._tcp.dc.test.com. DNAME RRSIG NSEC
 enum.test.com. IN      NSEC    86400   hightxt.test.com. NAPTR RRSIG NSEC
 hightxt.test.com.      IN      NSEC    86400   ns1.test.com. TXT RRSIG NSEC SPF
 ns1.test.com.  IN      NSEC    86400   ns2.test.com. A RRSIG NSEC
index c7fd31997e916f3bc7e3e2cbb0cc3db24dcfe5b4..6e41649cd6f7f456af5cdeb8feb5cbb9eee74eb5 100644 (file)
@@ -1,6 +1,7 @@
 0bh8di769i8vvtkdds8efjda19abigo5.test.com.     IN      NSEC3   86400   1 0 1 abcd 2EU2GULBU53H9UVHFALSHPBO2A83T6L2 TXT RRSIG SPF
 2eu2gulbu53h9uvhfalshpbo2a83t6l2.test.com.     IN      NSEC3   86400   1 0 1 abcd 2GKS2N3JPQF62QOHAVFQ1PHOLM3HR7RA NS SOA MX RRSIG DNSKEY NSEC3PARAM
-2gks2n3jpqf62qohavfq1pholm3hr7ra.test.com.     IN      NSEC3   86400   1 0 1 abcd 53L445R26RG1CSBI4TS1K3I3EL1F30VM TXT RRSIG
+2gks2n3jpqf62qohavfq1pholm3hr7ra.test.com.     IN      NSEC3   86400   1 0 1 abcd 4UL8F3M96VCONEA85U93DH9SG570J4FU TXT RRSIG
+4ul8f3m96vconea85u93dh9sg570j4fu.test.com.     IN      NSEC3   86400   1 0 1 abcd 53L445R26RG1CSBI4TS1K3I3EL1F30VM DNAME RRSIG
 53l445r26rg1csbi4ts1k3i3el1f30vm.test.com.     IN      NSEC3   86400   1 0 1 abcd 79RA8K3G5KAI1HG9JLHBR6P0TP933M7V SRV RRSIG
 79ra8k3g5kai1hg9jlhbr6p0tp933m7v.test.com.     IN      NSEC3   86400   1 0 1 abcd 79U3DAS6UCCTNS1BR3TVD8QKANNI351L A RRSIG
 79u3das6ucctns1br3tvd8qkanni351l.test.com.     IN      NSEC3   86400   1 0 1 abcd 7MMURA8H40BE5N4KOAN7RNMKURSAMH99
index 4088b798d5d1f0fb35b1be6218d6645389cadc5c..d050528e67aa1fabe00756541f31e044de669830 100644 (file)
@@ -1,6 +1,7 @@
 0bh8di769i8vvtkdds8efjda19abigo5.test.com.     IN      NSEC3   86400   1 1 1 abcd 2EU2GULBU53H9UVHFALSHPBO2A83T6L2 TXT RRSIG SPF
 2eu2gulbu53h9uvhfalshpbo2a83t6l2.test.com.     IN      NSEC3   86400   1 1 1 abcd 2GKS2N3JPQF62QOHAVFQ1PHOLM3HR7RA NS SOA MX RRSIG DNSKEY NSEC3PARAM
-2gks2n3jpqf62qohavfq1pholm3hr7ra.test.com.     IN      NSEC3   86400   1 1 1 abcd 53L445R26RG1CSBI4TS1K3I3EL1F30VM TXT RRSIG
+2gks2n3jpqf62qohavfq1pholm3hr7ra.test.com.     IN      NSEC3   86400   1 1 1 abcd 4UL8F3M96VCONEA85U93DH9SG570J4FU TXT RRSIG
+4ul8f3m96vconea85u93dh9sg570j4fu.test.com.     IN      NSEC3   86400   1 1 1 abcd 53L445R26RG1CSBI4TS1K3I3EL1F30VM DNAME RRSIG
 53l445r26rg1csbi4ts1k3i3el1f30vm.test.com.     IN      NSEC3   86400   1 1 1 abcd 79RA8K3G5KAI1HG9JLHBR6P0TP933M7V SRV RRSIG
 79ra8k3g5kai1hg9jlhbr6p0tp933m7v.test.com.     IN      NSEC3   86400   1 1 1 abcd 79U3DAS6UCCTNS1BR3TVD8QKANNI351L A RRSIG
 79u3das6ucctns1br3tvd8qkanni351l.test.com.     IN      NSEC3   86400   1 1 1 abcd 7MMURA8H40BE5N4KOAN7RNMKURSAMH99
index 142dea3b25c6e69b93a64b494253c1045f818c61..7a74777bf5e21794048afdcdeeafa41a1dde9ea8 100644 (file)
@@ -37,3 +37,4 @@ b.c                   IN      A       5.6.7.8
 aland          IN TXT "\195\133LAND ISLANDS"
 hightxt                IN      TXT     "v=spf1 mx ip4:78.46.192.210 –all"
 hightxt                IN      SPF     "v=spf1 mx ip4:78.46.192.210 –all"
+d              IN      DNAME   d2.test2.com.