From: bert hubert Date: Thu, 19 Feb 2015 08:47:52 +0000 (+0100) Subject: sample configuration file X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~88^2~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dea07d28bdb19158bc48b8701f4cbf3c3621bfa;p=thirdparty%2Fpdns.git sample configuration file --- diff --git a/pdns/dnsdistconf.lua b/pdns/dnsdistconf.lua new file mode 100644 index 0000000000..c1d6346250 --- /dev/null +++ b/pdns/dnsdistconf.lua @@ -0,0 +1,42 @@ + + +-- define the good servers +good={newServer("8.8.8.8"), newServer("8.8.4.4"), newServer("208.67.222.222"), newServer("208.67.220.220")} + +-- this is where we send bad traffic +abuse={newServer("127.0.0.1:5300")} + + +-- called before we distribute a question +function blockFilter(remote, qname, qtype) +-- print("Called about ",remote:tostring(), qname, qtype) + + if(qname == "powerdns.org.") + then + print("Blocking powerdns.org") + return true + end + return false +end + +counter=0 + +block=newDNSName("ezdns.it.") + +-- called to pick a downstream server +function pickServer(remote, qname, qtype) + print("qname: ",qname:tostring()) + local servers + if(qname:isPartOf(block)) + then + servers=abuse + else + servers=good + end + + counter=counter+1; + return servers[1 + (counter % #servers)] +end + + +