]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Thanks #lua - to match on 'www.' in Lua, use 'www%.'.
authorBert Hubert <bert.hubert@netherlabs.nl>
Mon, 23 Jun 2008 19:03:37 +0000 (19:03 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Mon, 23 Jun 2008 19:03:37 +0000 (19:03 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1223 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/docs/pdns.sgml
pdns/powerdns-example-script.lua

index bdef81573a32d18828fbe4eaccc7691a9a2e882c..98e46d9073d08842957bb455771e18b7de0e6a57 100644 (file)
@@ -8253,7 +8253,7 @@ function nxdomain ( ip, domain, qtype )
 
   ret={}
   if qtype ~= pdns.A then return -1, ret end  --  only A records
-  if not string.find(domain, "^www.") then return -1, ret end  -- only things that start with www.
+  if not string.find(domain, "^www%.") then return -1, ret end  -- only things that start with www.
   if not matchnetmask(ip, "10.0.0.0/8", "192.168.0.0/16")  then return -1, ret end -- only interfere with local queries
   ret[1]={qtype=pdns.A, content="127.1.2.3"}    -- add IN A 127.1.2.3
   ret[2]={qtype=pdns.A, content="127.3.2.1"}    -- add IN A 127.3.2.1
@@ -8341,7 +8341,7 @@ end
          </warning>
        </para>
        <para>
-         Finally, the function <function>matchnetmask(ip, netmask1, netmask2..)</function> is available to match incoming queries against
+         Finally, the function <function>matchnetmask(ip, netmask1, netmask2..)</function> (or <function>matchnetmask(ip, {netmask1, netmask2})</function>) is available to match incoming queries against
          a number of netmasks. If any of these matches, the function returns true.
        </para>
       </sect2>
index 98788f4d099ea84eb3d8677a0ad58c8ab4f02559..cb461d20d2e9fffbf1f710c6abaa71bb33d5997f 100644 (file)
@@ -28,9 +28,9 @@ end
 function nxdomain ( ip, domain, qtype )
        print ("nxhandler called for: ", ip, domain, qtype, pdns.AAAA)
        if qtype ~= pdns.A then return -1, {} end  --  only A records
-       if not string.find(domain, "^www.") then return -1, {} end  -- only things that start with www.
+       if not string.find(domain, "^www%.") then return -1, {} end  -- only things that start with www.
        
-       if matchnetmask(ip, {"127.0.0.1/32", "10.1.0.0/16"}) -- , "192.168.0.0/16", "172.16.0.0/12", "::/0")
+       if matchnetmask(ip, {"127.0.0.1/32", "10.1.0.0/16"}) 
        then 
                print "dealing"
                ret={}