Because I am using vservers using bind was not really an option in my setup (there are ways to use bind within vservers, however I wanted a clean setup that is easily maintained). I therefor decided to run PowerDNS within my vservers. I did my installation on Gentoo but it can be easily adapted to any distro of choice.
Gentoo:
emerge sync && emerge pdns && rc-update add pdns default
After the installation has been finished, we need to configure PowerDNS to use the SysCP generated config... All relevant settings can be found below:
################################# # allow-axfr-ips If disabled, DO allow zonetransfers from these IP addresses # allow-axfr-ips=(TRUSTED AXFR HOSTS HERE) ################################# # daemon Operate as a daemon # daemon=yes ################################# # disable-axfr Disable zonetransfers but do allow TCP queries # disable-axfr=no ################################# # guardian Run within a guardian process # guardian=yes ################################# # launch Which backends to launch and order to query them in # launch=bind ################################# # bind Backend Settings # # Location of the Bind configuration file to parse. bind-config=/etc/bind/named.conf # How often to check for zone changes. See 'Operation' section. bind-check-interval=300 # Enable Huffman compression on zone data. bind-enable-huffman=no ################################# # local-address Local IP address to which we bind # local-address=(YOUR IP HERE) ################################# # local-port The port on which we listen # local-port=53 ################################# # master Act as a master # master=yes ################################# # recursor If recursion is desired, IP address of a recursing nameserver # recursor=no ################################# # slave Act as a slave # slave=no ################################# # socket-dir Where the controlsocket will live # socket-dir=/var/run
Start powerdns and perform the usual checks to see if all works well.
Gentoo:
/etc/init.d/pdns start
On a side note; I created a small cron script to change the SOA on a daily basis, required if you move your vhosts around from one server to another for example (the script runs from cron.daily):
### Remove stale lockfile for SysCP - if needed
rm -f /var/run/syscp_cron.lock* 2>/dev/null
### Update SOA serial for the default.zone file
ZONEFILE=/etc/bind/default.zone
if [ -f $ZONEFILE ]; then
cp -a $ZONEFILE $ZONEFILE.new ;# Copy original file for permissions
sed s/'\t'.*\ \;\ serial/'\t'`date +%Y%m%d01`\ \;\ serial/ $ZONEFILE > $ZONEFILE.new
mv $ZONEFILE.new $ZONEFILE
fi
If you encounter problems, or have suggestions (perhaps an update on how to setup powerdns on Debian), either post in the forum, or modify this wiki entry.