Installing PowerDNS With MySQL On CentOS

Channel: Linux
Abstract: written in C++ and licensed under the GPL. PowerDNS can be managed through a web interface (PowerAdmin). This guide shows how to install it on CentOS.
Installing PowerDNS With MySQL On CentOS What is PowerDNS?

PowerDNS is a MySQL-based DNS server, written in C++ and licensed under the GPL. PowerDNS can be managed through a web interface (PowerAdmin). This guide shows how to install it on CentOS.

 

1. Installing MySQL
[[email protected] ~]# yum -y install mysql mysql-server

 

2. Create system startup links for MySQL
[[email protected] ~]# chkconfig --levels 235 mysqld on
[[email protected] ~]# service mysqld start

 

3. Check if MySQL is running
[[email protected] ~]# netstat -tap | grep mysql
tcp        0      0 *:mysql                 *:*     LISTEN   28179/mysqld 

 

4. Set password for user root
[[email protected] ~]# mysqladmin -u root password password123

 

5. Install PowerDNS
[[email protected] ~]# yum -y install pdns pdns-backend-mysql

 

6. Setting database
[[email protected] ~]# mysql -u root -p
mysql> CREATE DATABASE powerdns;
mysql> user powerdns;

mysql> CREATE TABLE domains (
-> id INT auto_increment,
-> name VARCHAR(255) NOT NULL,
-> master VARCHAR(128) DEFAULT NULL,
-> last_check INT DEFAULT NULL,
-> type VARCHAR(6) NOT NULL,
-> notified_serial INT DEFAULT NULL,
-> account VARCHAR(40) DEFAULT NULL,
-> primary key (id)
-> );

mysql> CREATE UNIQUE INDEX name_index ON domains(name);

mysql> CREATE TABLE records (
-> id INT auto_increment,
-> domain_id INT DEFAULT NULL,
-> name VARCHAR(255) DEFAULT NULL,
-> type VARCHAR(6) DEFAULT NULL,
-> content VARCHAR(255) DEFAULT NULL,
-> ttl INT DEFAULT NULL,
-> prio INT DEFAULT NULL,
-> change_date INT DEFAULT NULL,
-> primary key(id)
-> );

mysql> CREATE INDEX rec_name_index ON records(name);
mysql> CREATE INDEX nametype_index ON records(name,type);
mysql> CREATE INDEX domain_id ON records(domain_id);

mysql> CREATE TABLE supermasters (
-> ip VARCHAR(25) NOT NULL,
-> nameserver VARCHAR(255) NOT NULL,
-> account VARCHAR(40) DEFAULT NULL
-> );

mysql> quit;
[[email protected] ~]# nano /etc/pdns/pdns.conf
#################################
# launch Which backends to launch and order to query them in
#
# launch=

launch=gmysql

gmysql-host=192.200.200.1

gmysql-user=power_admin

gmysql-password=password123

gmysql-dbname=powerdns

#################################

 

7. Create the system startup links for PowerDNS
[[email protected] ~]# chkconfig --levels 235 pdns on
[[email protected] ~]# service pdns start

 

8. Preparing the system for PowerAdmin installation
[[email protected] ~]# yum -y install httpd php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mhash gettext

 

9. Create system startup links for apache and start it
[[email protected] ~]# chkconfig --levels 235 httpd on
[[email protected] ~]# service httpd start

 

10. Install following two PEAR packages
yum -y install php-pear-DB php-pear-MDB2-Driver-mysql

 

11. Download PowerAdmin
[[email protected] ~]# wget https://www.poweradmin.org/download/poweradmin-2.1.2.tgz
[[email protected] ~]# tar zxvf poweradmin-2.1.2.tgz -C /var/www/html/
[[email protected] ~]# mv poweradmin-2.1.2 poweradmin
[[email protected] ~]# mv /var/www/html/poweradmin/inc/config.inc.php
[[email protected] ~]# chown -R apache:apache /var/www/html/poweradmin/

Ref From: howtoforge

Related articles