Get Virtualizor

PowerDNS

This page explains how to setup PowerDNS for Virtualizor. The Virtualizor-PDNS install script will install PowerDNS, MySql and other dependencies and will setup database replication between the primary and secondary nameservers.

Requirements

Create two small VPS with CentOS 6/7 64 bit Or AlmaLinux 8 64 bit bit Or Ubuntu 18.04/20.04/22.04 64 bit , 512MB Ram or more, 10GB HDD or more.

You should have at least 2 DNS servers in your setup.
The setup should be as below :

  • One VPS for primary nameserver
  • One VPS for Secondary nameserver
  • SSH access to both VPSs and should be ping-able to each other
  • SSH port, DNS port (53) and MySQL Database port (3306) must be unblocked on both PDNS servers
E.g
CentOS 7.x / AlmaLinux 8.x
you can run below command to unblock ports 3306 and 53:
firewall-cmd --add-port 3306/tcp --permanent
firewall-cmd --add-port 53/tcp --permanent
firewall-cmd --add-port 53/udp --permanent
firewall-cmd --reload
Note
Virtualizor PowerDNS can be installed ONLY on 64 bit Machines.
We use the repository provided by PowerDNS itself : https://repo.powerdns.com/

Installation

These instructions are to be run only on the primary nameserver.

  • Download the Virtualizor PowerDNS install script onto the VPS that you have assigned to be your primary nameserver.
  • The PowerDNS install script executed on the primary name server will automatically install and configure the secondary nameserver. Make sure you have pass the correct parameters of the secondary server.
root> wget http://files.virtualizor.com/pdns_install.sh
  • Make the script executable
root> chmod +x pdns_install.sh
  • Run the script
root> ./pdns_install.sh --mysql-username=root --mysql-password='password' --virt-serverip=xxx.xxx.xxx.xxx \ --masterns-ip=xxx.xxx.xxx.xxx --slavens-ip=xxx.xxx.xxx.xxx --slavens-rootpass='password' --slavens-sshport=xxx

Add more Slaves to PDNS Master

In order to add more slaves to the existing PowerDNS setup perform the below steps. These instructions are to be run only on the primary nameserver.

root> wget http://files.virtualizor.com/pdns_slave_install.sh
  • Make the script executable
root> chmod +x pdns_slave_install.sh
  • Run the script
root> ./pdns_slave_install.sh --mysql-username=root --mysql-password='password' --virt-serverip=xxx.xxx.xxx.xxx \ --masterns-ip=xxx.xxx.xxx.xxx --slavens-ip=xxx.xxx.xxx.xxx --slavens-rootpass='password' --slavens-id=xxx --slavens-sshport=xxx
Note
All the arguments are compulsory. All the parameters to be specified on the same line.

Parameters breakdown

  • After running the script, run the following command to verify installation by running one of the following commands.
$ service pdns status

OR

$ systemctl status pdns

OR

$ /etc/init.d/pdns status
Next
To Configure powerDNS in virtualizor please refer the below guide:
https://www.virtualizor.com/docs/admin/configure-powerdns/

Troubleshooting

1. If the installer fails or gives any error then its better to start with fresh VPS setup else it will give issues later on with PDNS sync.

2. If panel is not able to reach PDNS vps then try to telnet 3306 port of primary NS vps from Master server. If it is getting refused it's probably an issue with firewall of VPS/Master server .

You can also verify if pdns service is started or not within NS vps.
Mysql logs are under /var/log/ on both pdns vpses.
Mysql config is /etc/my.cnf and
pdns conf is /etc/pdns/pdns.conf  (for ubuntu /etc/powerdns/pdns.conf)

If everything is proper then grant privileges for remote login for root user using following commands in primary NS vps :

cat /etc/pdns/pdns.conf | grep mysql
For Ubuntu 
cat /etc/powerdns/pdns.conf | grep mysql

After getting the mysql password, proceed with login :

mysql -u root -p
[mysql]> use mysql;
[mysql]> GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'MYSQL-PASS';
[mysql]> FLUSH PRIVILEGES;

'MYSQL-PASS' of master NS can be found within master NS vps as well

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list