-
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:
sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved
Next, remove the default resolv.conf file and create new one with the following command:
sudo rm /etc/resolv.conf
sudo echo "nameserver 8.8.8.8" > /etc/resolv.conf
Now, install PowerDNS with the following command:
sudo echo "deb [arch=amd64] http://repo.powerdns.com/ubuntu bionic-auth-41 main" > /etc/apt/sources.list.d/pdns.list
sudo curl https://repo.powerdns.com/FD380FBB-pub.asc | sudo apt-key add -
sudo echo "deb http://cz.archive.ubuntu.com/ubuntu bionic main" > /etc/apt/sources.list.d/bionic.list
sudo echo "deb http://security.ubuntu.com/ubuntu xenial-security main " > /etc/apt/sources.list.d/xenial.list
sudo apt-get update
sudo apt-get install pdns-server pdns-backend-mysql
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:
sudo 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:
sudo systemctl restart pdns
Then, executing this will start PowerDNS service on boot:
sudo systemctl enable pdns
You can also check the status of PowerDNS with the following command:
sudo systemctl status pdns
You should see the following output:
pdns.service – PowerDNS Authoritative Server