PowerDNS
Jump to navigation
Jump to search
Dependences
apt-get install pdns-server pdns-recursor
PowerDNS server
diff pdns.conf /etc/powerdns/pdns.conf
32c32 < config-dir=/srv/config/etc/powerdns --- > config-dir=/etc/powerdns 197c197 < recursor=127.0.0.1:10053 --- > # recursor= 314c314 < include=/srv/config/etc/powerdns/pdns.d --- > include=/etc/powerdns/pdns.d
diff pdns.d/pdns.local /etc/powerdns/pdns.d/pdns.local
4,5d3 < launch=bind < bind-config=/srv/config/etc/powerdns/bind/named.conf
PowerDNS recursor
diff recursor.conf /etc/powerdns/recursor.conf
< hint-file=/srv/config/etc/powerdns/bind/db/db.root --- > # hint-file= 101c101 < local-port=10053 --- > local-port=53
Bind style zones
cat bind/named.conf
# named.conf // prime the server with knowledge of the root servers zone "." { type hint; file "/srv/config/etc/powerdns/bind/db/db.root"; }; // be authoritative for the localhost forward and reverse zones, and for // broadcast zones as per RFC 1912 zone "localhost" { type master; file "/srv/config/etc/powerdns/bind/db/db.local"; }; zone "127.in-addr.arpa" { type master; file "/srv/config/etc/powerdns/bind/db/db.127"; }; zone "0.in-addr.arpa" { type master; file "/srv/config/etc/powerdns/bind/db/db.0"; }; zone "255.in-addr.arpa" { type master; file "/srv/config/etc/powerdns/bind/db/db.255"; };
- End
db files
db.local
; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA localhost. root.localhost. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost. @ IN A 127.0.0.1 @ IN AAAA ::1
db.127
; ; BIND reverse data file for local loopback interface ; $TTL 604800 @ IN SOA localhost. root.localhost. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost. 1.0.0 IN PTR localhost.
db.0
; ; BIND reverse data file for broadcast zone ; $TTL 604800 @ IN SOA localhost. root.localhost. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost.
db.255
; ; BIND reverse data file for broadcast zone ; $TTL 604800 @ IN SOA localhost. root.localhost. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost.
update_hint.sh
#!/bin/bash # NAME=db.root dig +bufsize=1200 +norec NS . @a.root-servers.net > ${NAME}_new || exit test -s ${NAME}_new && (test -f ${NAME} && mv ${NAME} ${NAME}_old || true) && mv ${NAME}_new ${NAME} chown pdns:pdns ${NAME} chmod 600 ${NAME} cat ${NAME} # End
References
- http://chenyufei.info/blog/2010-12-19/powerdns-setup-on-debian-lenny-using-bind-or-sqlite3-backend/
- http://laurent.bachelier.name/2009/03/switching-from-bind-to-powerdns-in-a-few-seconds/
- http://pgl.yoyo.org/adservers/bind-zone-file-creator.php
- http://www.webhostingtalk.com/showthread.php?t=917219
- http://doc.powerdns.com/built-in-recursor.html#recursor-settings