[Pdns-users] Running pdns alongside pdns-recursor on the same host

Daniel L. Miller dmiller at amfes.com
Thu Jun 7 15:42:21 UTC 2012


On 6/7/2012 7:38 AM, Odhiambo Washington wrote:
>
> Do you mind showing me the snippets?
>
> Also, if I may ask - I did not already see if PowerDNS supports views 
> and ACLs. Is it just that I am thinking so much BINDism?:-)
>

I never used BIND - I found it too confusing.  I'm inferring the terms 
you're asking about are access-control or limited-report related.  I 
don't believe PowerDNS has these natively - you may be able to achieve 
what you need via lua or running additional server processes with 
different settings.

# Mostly defaults - I believe I just changed the local-port
pdns.conf:
allow-recursion=127.0.0.1
config-dir=/etc/powerdns
daemon=yes
disable-axfr=yes
guardian=yes
lazy-recursion=yes
local-port=10053
module-dir=/usr/lib/powerdns
setgid=pdns
setuid=pdns
socket-dir=/var/run
version-string=powerdns
include=/etc/powerdns/pdns.d

# Magic comes from forward-zones-file and lua-dns-script settings.
# lua used to provide split-horizon service, so internal LAN clients 
resolve my public domains to internal IP's.
recursor.conf:
forward-zones-file=/etc/powerdns/forward-zones
# I use two addresses because I had an old server - just in case there's 
some clients looking for the address
local-address=192.168.0.2,192.168.0.72
local-port=53
lua-dns-script=/etc/powerdns/amfes.lua
quiet=yes
setgid=pdns
setuid=pdns

foward-zones:
amfes.com=127.0.0.1:10053
amfeslan.local=127.0.0.1:10053
0.168.192.in-addr.arpa=127.0.0.1:10053
27.172.in-addr.arpa=127.0.0.1:10053
56.168.192.in-addr.arpa=127.0.0.1:10053

amfes.lua:
function preresolve ( requestorip, domain, qtype )
     if string.find( domain, "amfes.com." ) and qtype == pdns.A then
         return 0, { { qtype=pdns.A, content="192.168.0.4" } }
     else
         return -1, {}
     end
end

-- 
Daniel



More information about the Pdns-users mailing list