]> granicus.if.org Git - pdns/commitdiff
switch ghost domain 1 to wildcards; add second, simpler ghost domain
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 28 Jan 2013 07:59:03 +0000 (07:59 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 28 Jan 2013 07:59:03 +0000 (07:59 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3083 d19b8d6e-7fed-0310-83ef-9ca221ded41b

regression-tests.recursor/config.sh

index 9b939ff71d2009ebd0908bbefade3886bfc2af4a..b8996d26700243f588eb80bd97f4f1103a7e6cde 100755 (executable)
@@ -171,15 +171,17 @@ ghost.example.net.      3600 IN NS  ns.ghost.example.net.
 ns.ghost.example.net.   3600 IN A   $PREFIX.17
 1.ghost.example.net.      10 IN NS  ns.1.ghost.example.net.
 ns.1.ghost.example.net.   10 IN A   $PREFIX.18
+2.ghost.example.net.      10 IN NS  ns.2.ghost.example.net.
+ns.2.ghost.example.net.   10 IN A   $PREFIX.19
 EOF
 
-### ghost domain
+### ghost domain with ever-changing NSset
 mkdir $PREFIX.18
 cat > $PREFIX.18/1.ghost.example.net.zone <<EOF
 1.ghost.example.net.    3600 IN SOA $SOA
 1.ghost.example.net.      20 IN NS  ns.1.ghost.example.net.
 ns.1.ghost.example.net.   20 IN A   $PREFIX.18
-www.1.ghost.example.net.  20 IN A   192.0.2.7
+*.www.1.ghost.example.net.  20 IN A   192.0.2.7
 EOF
 
 cat > $PREFIX.18/prequery.lua <<EOF
@@ -188,7 +190,7 @@ i=0
 function prequery ( dnspacket )
     i = i + 1
     qname, qtype = dnspacket:getQuestion()
-    if qtype == pdns.A and string.sub(qname, -20) == ".1.ghost.example.net"
+    if qtype == pdns.A and string.sub(qname, -24) == ".www.1.ghost.example.net"
     then
         dnspacket:setRcode(pdns.NOERROR)
         ret = {}
@@ -205,6 +207,30 @@ function prequery ( dnspacket )
 end
 EOF
 
+### ghost domain with static NSset
+mkdir $PREFIX.19
+cat > $PREFIX.19/2.ghost.example.net.zone <<EOF
+2.ghost.example.net.    3600 IN SOA $SOA
+2.ghost.example.net.      20 IN NS  ns.2.ghost.example.net.
+ns.2.ghost.example.net.   20 IN A   $PREFIX.19
+*.www.2.ghost.example.net.  20 IN A   192.0.2.8
+EOF
+cat > $PREFIX.19/prequery.lua <<EOF
+function prequery ( dnspacket )
+    qname, qtype = dnspacket:getQuestion()
+    if qtype == pdns.A and string.sub(qname, -24) == ".www.2.ghost.example.net"
+    then
+        dnspacket:setRcode(pdns.NOERROR)
+        ret = {}
+        ret[1] = {qname=qname, qtype=pdns.A, content="192.0.2.8", ttl=20, place=1}
+        ret[2] = {qname="2.ghost.example.net", qtype=pdns.NS, content="ns.2.ghost.example.net", ttl=20, place=2}
+        ret[3] = {qname="ns.2.ghost.example.net", qtype=pdns.A, content="10.0.3.19", ttl=20, place=3}
+        dnspacket:addRecords(ret)
+        return true
+    end
+    return false
+end
+EOF
 
 for dir in $PREFIX.*
 do