-
Notifications
You must be signed in to change notification settings - Fork 1
How to install PowerDNS on Ubuntu
TO install PowerDNS on Ubuntu you will have to have installed the zone api php already then follow these instructions to install PowerDNS on Ubuntu...
First, you will need to disable systemd-resolve in order to PowerDNS work properly.
You can do it with the following command:
systemctl disable systemd-resolved
systemctl stop systemd-resolved
Next, remove the default resolv.conf file and create new one with the following command:
rm /etc/resolv.conf
echo "nameserver 8.8.8.8" > /etc/resolv.conf
Now, install PowerDNS with the following command:
cd /var
git clone https://github.com/PowerDNS/pdns.git
cd pdns
apt install libcurl4-openssl-dev libyaml-cpp-dev autoconf automake ragel bison flex g++ libboost-all-dev libtool make pkg-config libssl-dev virtualenv libyaml-cpp-dev libcurl4 gawk libsodium-dev default-libmysqlclient-dev libsystemd0 libsystemd-dev libmaxminddb-dev libmaxminddb0 libgeoip1 libgeoip-dev luajit lua-yaml-dev libtolua-dev lua5.3 lua-yaml-dev libluajit-5.1-dev-y
cd ./pdns
rm lua*
cd ../
autoreconf -vi
./configure --with-modules="gmysql geoip" --with-libsodium --enable-systemd --disable-lua-records --with-lua=5.3
make install
During the installation, you will be asked whether to configure the PowerDNS database with dbconfig-common. Select No and press Enter to continue the installation.
Next, you will need to configure PowerDNS to use MySQL. You can do it by editing PowerDNS configuration file this is too point to your Zone API PHP Database:
nano /etc/powerdns/pdns.d/pdns.local.gmysql.conf
Make the following changes (For more information see: https://doc.powerdns.com/authoritative/backends/generic-mysql.html):
launch+=gmysql
gmysql-host=localhost
gmysql-port=3306
gmysql-dbname=powerdns
gmysql-user=powerdns
gmysql-password=password
gmysql-dnssec=yes
Save and close the file. Then, restart PowerDNS service to apply the changes:
systemctl restart pdns
Then, executing this will start PowerDNS service on boot:
systemctl enable pdns
You can also check the status of PowerDNS with the following command:
systemctl status pdns
You should see the following output:
pdns.service – PowerDNS Authoritative Server