From aa0374e56613984fcdaff315dd00a3e8d2d3048d Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Sat, 21 Jun 2008 21:37:07 +0000 Subject: [PATCH] make builds semi-static, plus improve powerdns-example-script in an important way git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1213 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- pdns/build-recursor | 2 ++ pdns/powerdns-example-script.lua | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pdns/build-recursor b/pdns/build-recursor index ca8ebffb9..9039bdb40 100755 --- a/pdns/build-recursor +++ b/pdns/build-recursor @@ -1,6 +1,8 @@ #!/bin/sh cd pdns-recursor-$1 dh_make -e bert.hubert@netherlabs.nl -b -f ../pdns-recursor-$1.tar.bz2 < /dev/null +export LUA=1 +export STATIC=semi fakeroot debian/rules binary fakeroot rpmbuild -bb ../pdns-recursor.spec \ No newline at end of file diff --git a/pdns/powerdns-example-script.lua b/pdns/powerdns-example-script.lua index 8599ca4df..98788f4d0 100644 --- a/pdns/powerdns-example-script.lua +++ b/pdns/powerdns-example-script.lua @@ -1,11 +1,10 @@ function preresolve ( ip, domain, qtype ) print ("prequery handler called for: ", ip, domain, qtype) - if domain == "www.ds9c.nl." + if domain == "www.powerdns.org." then ret={} - ret[1]= {qtype=pdns.A, content="9.8.7.6", ttl=3601} - ret[2]= {qtype=pdns.A, content="1.2.3.4", ttl=3601} + ret[1]= {qtype=pdns.A, content="85.17.219.141", ttl=86400} print "dealing!" return 0, ret elseif domain == "www.baddomain.com." @@ -31,7 +30,7 @@ function nxdomain ( ip, domain, qtype ) 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 matchnetmask(ip, "10.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12", "::/0") + if matchnetmask(ip, {"127.0.0.1/32", "10.1.0.0/16"}) -- , "192.168.0.0/16", "172.16.0.0/12", "::/0") then print "dealing" ret={} -- 2.40.0