[Pdns-users] use of pdnslog() in pdns-recursor lua scripts

2010-07-16 Thread Kenneth Marshall
Hello PDNS community,

I have been trying to get the pdnslog() function to work
in my lua script for the pdns-recursor. Here is my current
script. Originally it was like the example script:

function preresolve ( remoteip, domain, qtype )
print (prequery handler called for: , remoteip, getlocaladdress(), dom
ain, qtype)
pdnslog(a test message.. received query from ..remoteip.. on ..getlo
caladdress());
if domain == www.mybad.org. 
then
print dealing - faking www.mybad.org
return pdns.NXDOMAIN, {}
else
return -1, {}
end
end

And this did successfully log the a test message... in the
local3 via syslog. I changed it to:

function preresolve ( remoteip, domain, qtype )
if domain == www.bad1.com. 
then
print dealing - phishing www.bad1.com
pdnslog(dealing - phishing www.bad1.com);
return pdns.NXDOMAIN, {}
elseif domain == www.bad2.com.
then
print dealing - phishing www.bad2.com
pdnslog(dealing - phishing www.bad2.com);
return pdns.NXDOMAIN, {}
else
return -1, {}
end
end

While it successfully returns NXDOMAIN, it is not logging
to syslog local3. Does anyone have any ideas about what is
going wrong? Is my syntax correct?

Thank you for any assistance.
Regards,
Ken

___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
http://mailman.powerdns.com/mailman/listinfo/pdns-users


[Pdns-users] sqlite and backslash escapes

2010-07-16 Thread Andy Smith
Hello,

One of my users, from whom I take an AXFR, has been experimenting
with DNS Service Discovery (http://www.dns-sd.org/).

Into his BIND zone file he put the following:

$ORIGIN _tcp.atomic-x.co.uk.
_autodiscover   SRV 0 0 443 atomic-x.co.uk.
_http   PTR atomic-x\.co\.uk\032Webmail._http
PTR atomic-x\.co\.uk\032Homepage._http

and on one of my BIND slaves, it appears the same as above. My PDNS
servers (using sqlite) took an AXFR of this and ended up storing the
following in the DB:

sqlite select * from records where domain_id=70 and type=PTR;
180258|70|_http._tcp.atomic-x.co.uk|PTR|atomic-x\\.co\\.uk\\ 
Webmail._http._tcp.atomic-x.co.uk.|1800|0|
180259|70|_http._tcp.atomic-x.co.uk|PTR|atomic-x\\.co\\.uk\\ 
Homepage._http._tcp.atomic-x.co.uk.|1800|0|
180264|70|b._dns-sd._udp.atomic-x.co.uk|PTR|atomic-x.co.uk.|1800|0|
180265|70|lb._dns-sd._udp.atomic-x.co.uk|PTR|atomic-x.co.uk.|1800|0|

The backslash-escaped space there does not look correct.

When I query a bind9 server, I get the expected response:

$ dig +noall +answer -t ptr _http._tcp.atomic-x.co.uk @a.authns.bitfolk.com.
_http._tcp.atomic-x.co.uk. 1800 IN  PTR 
atomic-x\.co\.uk\032Homepage._http._tcp.atomic-x.co.uk.
_http._tcp.atomic-x.co.uk. 1800 IN  PTR 
atomic-x\.co\.uk\032Webmail._http._tcp.atomic-x.co.uk.

The same towards one of the PDNS servers:

$ dig +noall +answer -t ptr _http._tcp.atomic-x.co.uk @b.authns.bitfolk.com.
_http._tcp.atomic-x.co.uk. 1800 IN  PTR atomic-x\.co\.uk\\\000.
_http._tcp.atomic-x.co.uk. 1800 IN  PTR atomic-x\.co\.uk\\\000.

Is this a bug? Any workaround here?

pdns-backend-sqlite / pdns-server 2.9.21.2-1, Debian Lenny.

Cheers,
Andy
___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
http://mailman.powerdns.com/mailman/listinfo/pdns-users