How to Setup PowerDNS PowerAdmin Web GUI

How to Setup PowerDNS PowerAdmin Web GUI

 

In this article i will show how to install PowerDNS PowerAdmin Web GUI. First I will show how to install PowerDNS on CentOS. Our PowerDNS setup will use MySQL database in backend.

PowerDNS is a DNS server able serving very large query volumes and as very performance. Other advantage – PowerDNS is able give us lot of statistics (Log Messages, Queries for records,Remote server IP addresses, hosts sending corrupt packets).

After PowerDNS setup we will configure PowerAdmin Web GUI. Poweradmin is a friendly web based DNS administration tool PowerDNS server. The interface has full support for most of the features of PowerDNS. It has full support for all zone types (master, native and slave), for supermasters for automatic provisioning of slave zones, full support for IPv6 and comes with multi-language support. See feature list for all features.

 

 

PowerDNS setup

Install EPEL and REMI repositories:

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

 

Install php, mysql, pdns packages:

yum -y install php php-mcrypt php-pdo php-mysql pdns pdns-backend-mysql mysql-server httpd

 

Start httpd, mysqld, pdns services and add to autostart:

/etc/init.d/httpd start
/etc/init.d/mysqld start
/etc/init.d/pdns start
chkconfig httpd on
chkconfig mysqld on
chkconfig pdns on

 

PowerDNS MySQL backend

Create MySQL database ‘powerdns‘:

mysqladmin create powerdns -p

Create user ‘powerdns‘ and grant all ‘privileges‘ on ‘powerdns‘:

mysql -Bse "create user 'powerdns'@'localhost' identified by 'password'" -p
mysql -Bse "grant all privileges on powerdns.* to 'powerdns'@'localhost'" -p

 

Start MySql console:

# mysql -p
mysql> use powerdns;

 

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)
) Engine=InnoDB;

CREATE UNIQUE INDEX name_index ON domains(name);

CREATE TABLE records (
id                    INT AUTO_INCREMENT,
domain_id             INT DEFAULT NULL,
name                  VARCHAR(255) DEFAULT NULL,
type                  VARCHAR(10) DEFAULT NULL,
content               VARCHAR(64000) DEFAULT NULL,
ttl                   INT DEFAULT NULL,
prio                  INT DEFAULT NULL,
change_date           INT DEFAULT NULL,
disabled              TINYINT(1) DEFAULT 0,
ordername             VARCHAR(255) BINARY DEFAULT NULL,
auth                  TINYINT(1) DEFAULT 1,
PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
CREATE INDEX recordorder ON records (domain_id, ordername);

CREATE TABLE supermasters (
ip                    VARCHAR(64) NOT NULL,
nameserver            VARCHAR(255) NOT NULL,
account               VARCHAR(40) NOT NULL,
PRIMARY KEY (ip, nameserver)
) Engine=InnoDB;

CREATE TABLE comments (
id                    INT AUTO_INCREMENT,
domain_id             INT NOT NULL,
name                  VARCHAR(255) NOT NULL,
type                  VARCHAR(10) NOT NULL,
modified_at           INT NOT NULL,
account               VARCHAR(40) NOT NULL,
comment               VARCHAR(64000) NOT NULL,
PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX comments_domain_id_idx ON comments (domain_id);
CREATE INDEX comments_name_type_idx ON comments (name, type);
CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);

CREATE TABLE domainmetadata (
id                    INT AUTO_INCREMENT,
domain_id             INT NOT NULL,
kind                  VARCHAR(32),
content               TEXT,
PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);

CREATE TABLE cryptokeys (
id                    INT AUTO_INCREMENT,
domain_id             INT NOT NULL,
flags                 INT NOT NULL,
active                BOOL,
content               TEXT,
PRIMARY KEY(id)
) Engine=InnoDB;

CREATE INDEX domainidindex ON cryptokeys(domain_id);

CREATE TABLE tsigkeys (
id                    INT AUTO_INCREMENT,
name                  VARCHAR(255),
algorithm             VARCHAR(50),
secret                VARCHAR(255),
PRIMARY KEY (id)
) Engine=InnoDB;

CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);

Exit from MySQL console by typing: exit

Configuring database connectivity.
This backend called  ‘gmysql’ modify /etc/pdns/pdns.conf file, add following lines.

launch=gmysql
gmysql-host=127.0.0.1
gmysql-user=powerdns
gmysql-dbname=powerdns
gmysql-password=password

 

Restart PDNS:

service pdns restart

 

 

PowerDNS PowerAdmin Web GUI Setup

cd /root/
wget http://iweb.dl.sourceforge.net/project/poweradmin/poweradmin-2.1.7.tgz
tar xvfz poweradmin-2.1.7.tgz
cd poweradmin-2.1.7
mv inc/config-me.inc.php inc/config.inc.php

 

and edit inc/config.inc.php and provide all required values:

$db_host = 'localhost';
$db_port = '3306';
$db_user = 'powerdns';
$db_pass = 'password';
$db_name = 'powerdns';
$db_type = 'mysql';

$session_key = '1p0w54dm1n';

 

mkdir /var/www/html/pdns
cd /root/poweradmin-2.1.7
cp -R * /var/www/html/pdns/

 

point your browser to http://yourwebserver/pdns/install/
Setup PowerDNS PowerAdmin Web GUI

In step3 specify administrator password in last field:
Poweradmin_Installation1

 

step 4 is optional:
Poweradmin_Installation2

Finish the installation process then remove the directory “install/”

rm -rf /var/www/html/pdns/install/

 

Setup PowerDNS PowerAdmin Web GUI

Now point your browser to the web interface http://yourwebserver/pdns/install/ and login as admin with password you’ve specified in step 3

Test PowerDNS Server

 

Add test.com record, then look up the test record for your domain:

dig test.com A @127.0.0.1

You should see similar output:

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.2 <<>> test.com A @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34655
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;test.com.                      IN      A

;; ANSWER SECTION:
test.com.               86400   IN      A       10.10.10.10

;; Query time: 2 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri May  1 17:44:57 2015
;; MSG SIZE  rcvd: 42

 


 

 

If you like what you are reading, please:

Buy me a coffeeBuy me a coffee

arstech

Leave a Reply