How to Install PowerDNS and Poweradmin on CentOS 7
0

PowerDNS (pdns) is an open supply DNS server written in C++ and launched below GPL License. It has grow to be a superb different for the standard DNS server Bind, designed with higher efficiency and low reminiscence necessities. PowerDNS supplies two merchandise, the Authoritative server, and the Recursor. The PowerDNS Authoritative server could be configured by the totally different backend, together with the plain Bind zone information, RDBMS similar to MySQL, PostgreSQL, SQLite3 or LDAP.

On this tutorial, I’ll present you how one can set up and configure a PowerDNS Authoritative server with MariaDB database server as a Backend and utilizing Poweradmin for straightforward DNS administration.

Stipulations

  • CentOS 7 server
  • Root privileges

What we’ll do:

  1. Set up EPEL and Remi Repositories
  2. Set up and Configure MariaDB
  3. Set up PowerDNS
  4. Set up Poweradmin
  5. Poweradmin Put up-Set up
  6. Create Pattern Zone

Step 1 – Set up EPEL and Remi Repositories

To start with, we have to set up dependencies for the PowerDNS set up. We’ll set up the EPEL repository and the REMI for PHP 7.2 set up.

Set up EPEL and PHP Remi repository utilizing the next instructions.

yum -y set up epel-release
yum -y set up http://rpms.remirepo.net/enterprise/remi-release-7.rpm

As soon as these repositories are added to the system, set up the ‘yum-utils’ package deal.

yum -y set up yum-utils

And allow the PHP 7.2 Remi repository utilizing the next command.

yum-config-manager --enable remi-php72

Step 2 – Set up and Configure MariaDB

The PowerDNS Authoritative server has assist for a distinct backend, together with the MySQL/MariaDB database server. The phrases of ‘backend’ is a datastore that the server will seek the advice of that comprises DNS information (and a few meta-data). And for this information, we can be utilizing the MariaDB as a backend.

Set up MariaDB utilizing the next yum command.

yum -y set up mariadb mariadb-server

As soon as the set up is full, begin the MariaDB service and add it to the startup boot time.

systemctl begin mariadb
systemctl allow mariadb

Subsequent, we will configure the foundation password for the MariaDB utilizing the interactive software referred to as ‘mysql_secure_installation’.

Run the command under.

mysql_secure_installation

And you can be prompted for configuring the foundation password of the database server. Kind ‘Y’ to arrange the foundation password and sort a robust password.

Set root password? [Y/n] Y
New password:
Re-enter new password:

For the others, simply sort ‘Y’ to sure.

Take away nameless customers? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Take away check database and entry to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Because of this, you’ve got been put in the MariaDB database server and arrange the foundation password for authentication.

Subsequent, we’ll create a brand new database and person for the PowerDNS set up. Login to the MySQL shell with the person root and your password.

Run MySQL command under.

mysql -u root -p
PASSWORD

Now create a brand new database referred to as ‘powerdns’ and grant all of the database privileges to a brand new person named ‘pdns’ with password ‘pdnspassword2018’.

create database powerdns;
grant all privileges on powerdns.* to [email protected] recognized by 'pdnspassword2018';
flush privileges;

Install PowerDNS database

After that, create the tables buildings for the PowerDNS database by operating following MySQL queries under.

use powerdns;

CREATE TABLE domains (
  id                    INT AUTO_INCREMENT,
  title                  VARCHAR(255) NOT NULL,
  grasp                VARCHAR(128) DEFAULT NULL,
  last_check            INT DEFAULT NULL,
  sort                  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(title);

CREATE TABLE information (
  id                    BIGINT AUTO_INCREMENT,
  domain_id             INT DEFAULT NULL,
  title                  VARCHAR(255) DEFAULT NULL,
  sort                  VARCHAR(10) DEFAULT NULL,
  content material               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 information(title,sort);
CREATE INDEX domain_id ON information(domain_id);
CREATE INDEX recordorder ON information (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 feedback (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  title                  VARCHAR(255) NOT NULL,
  sort                  VARCHAR(10) NOT NULL,
  modified_at           INT NOT NULL,
  account               VARCHAR(40) NOT NULL,
  remark               VARCHAR(64000) NOT NULL,
  PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX comments_domain_id_idx ON feedback (domain_id);
CREATE INDEX comments_name_type_idx ON feedback (title, sort);
CREATE INDEX comments_order_idx ON feedback (domain_id, modified_at);

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

CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, type);

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

CREATE INDEX domainidindex ON cryptokeys(domain_id);

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

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

give up;

Because of this, the MySQL/MariaDB database and a person for PowerDNS set up has been created.

Step 3 – Set up PowerDNS

Set up PowerDNS and all packages wanted utilizing the next command.

yum -y set up pdns pdns-backend-mysql bind-utils

After putting in PowerDNS packages, go to the ‘/and so forth/pdns/’ listing and edit the configuration file ‘pdns.conf’ utilizing vim editor.

cd /and so forth/pdns/
vim pdns.conf

By default, PowerDNS is utilizing ‘bind’ because the backend. So, sort remark ‘#’ within the entrance of ‘launch=bind’ configuration and paste the MySQL backend configuration as under.

#launch=bind

launch=gmysql
gmysql-host=localhost
gmysql-user=pdns
gmysql-password=pdnspassword2018
gmysql-dbname=powerdns

Save and shut.

Install PowerDNS

Now begin the pdns service and add it to the startup boot time.

systemctl begin pdns
systemctl allow pdns

After that, add the DNS service to the firewall.

firewall-cmd --add-service=dns --permanent
firewall-cmd --reload

Configure the Firewall

And the PowerDNS service is up and operating, verify utilizing the next command.

netstat -tap | grep pdns
netstat -tulpn | grep 53
dig @10.9.9.10

Because of this, you’re going to get the pdns service is up and operating on port 53 and get the response from the PowerDNS server.

Check PowerDNS status

Step 4 – Set up Poweradmin

On this step, we will set up the DNS administration for PowerDNS referred to as ‘Poweradmin’. It is a internet software based mostly on PHP, so we have to set up PHP and internet server with the intention to run the applying.

Set up an httpd internet server and PHP packages utilizing the next command.

yum -y set up 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

After the set up, we have to set up further PHP Pear packages. Run the next command.

yum -y set up php-pear-DB php-pear-MDB2-Driver-mysqli

As soon as the httpd and PHP set up is full, begin the httpd service and add it to the startup boot time.

systemctl begin httpd
systemctl allow httpd

Subsequent, go to the ‘/var/www/html’ listing and obtain the poweradmin supply code.

cd /var/www/html/
wget http://downloads.sourceforge.net/project/poweradmin/poweradmin-2.1.7.tgz

Extract the poweradmin compressed file and rename it.

tar xvf poweradmin-2.1.7.tgz
mv poweradmin-2.1.7/ poweradmin/

After that, add the HTTP and HTTPS protocols to the firewall.

firewall-cmd --add-service={http,https} --permanent
firewall-cmd --reload

And we’re prepared for the poweradmin post-installation.

Step 5 – Poweradmin Put up-Set up

Open your internet browser and sort the server IP deal with plus the /poweradmin/set up/ path URL for the set up. Mine is:

http://10.9.9.10/poweradmin/install/

Select your most popular language and click on the ‘Go to Step 2’ button.

PowerAdmin setup 1

Now simply click on the ‘Go to Step 3’ button.

PowerAdmin setup 2

And you can be displayed for the database configuration. Kind the PowerDNS database particulars that we have created and the admin password for PowerDNS.

PowerAdmin database setup

Click on the ‘Go to Step 4’ button.

After that, you’ll need to create a brand new person will restricted proper privileges. Kind the small print as the next and alter the person, password, and so forth with your personal.

PowerAdmin user setup

Now click on ‘Go to Step 5’ button.

And you can be proven the web page as under.

PowerAdmin setup finished

Open once more your terminal server, log in with the foundation person and password. Then run the MySQL queries as on the web page.

mysql -u root -p
PASSWORD

GRANT SELECT, INSERT, UPDATE, DELETE
ON powerdns.*
TO 'hakase'@'localhost'
IDENTIFIED BY 'hakase-labs123';

Mysql commands

Now again to the net browser and click on the ‘Go to Step 6’ button.

And you can be proven the web page as under.

Installation step 6

The installer was unable to create a brand new configuration ‘../inc/config.inc.php’. So, we have to create it manually.

Again to the terminal server, go to the ‘/var/www/html/poweradmin’ listing and create a brand new configuration file ‘inc/config.inc.php’.

cd /var/www/html/poweradmin
vim inc/config.inc.php

Now paste the PHP script on the web page into it.

<?php
 
 $db_host                = 'localhost';
 $db_user                = 'hakase';
 $db_pass                = 'hakase-labs123';
 $db_name                = 'powerdns';
 $db_type                = 'mysql';
 $db_layer               = 'PDO';
 
 $session_key            = '[email protected]=uetwJeD2#uApgO)2Ekj+S#oN1Khhoj';
 
 $iface_lang             = 'en_EN';
 
 $dns_hostmaster         = 'server.hakase-labs.io';
 $dns_ns1                = 'ns1.hakase-labs.io';
 $dns_ns2                = 'ns2.hakase-labs.io';
 

Save and shut, then again to the browser and click on the button.

Database configuration file

And the set up is full.

Optionally:

If you wish to assist for the URLs utilized by different Dynamic suppliers, copy the htaccess file.

cd /var/www/html/poweradmin
cp set up/htaccess.dist .htaccess

After that, you MUST take away the ‘set up’ listing.

rm -rf /var/www/html/poweradmin/set up

.htaccess protection

Again once more to your internet browser and log in to the Poweradmin dashboard utilizing the URL as under.

http://10.9.9.10/poweradmin/

Log in with the default person ‘admin’ and the password, click on the ‘Go’ button.

PowerAdmin Login

And in consequence, you can be proven the Poweradmin dashboard and the set up is completed.

PowerAdmin Dashboard

Step 6 – Create Pattern Zone and DNS Information

At this stage, we’re going check the PowerDNS and Poweradmin set up by creating a brand new DNS zone for a site referred to as ’emma.io’.

On the Poweradmin dashboard, click on the ‘Add grasp zone’ menu.

Add master zone

Set the zone title with the area title ’emaa.io’ and click on ‘Add zone’ button.

Add DNS Zone in PowerAdmin

Click on the ‘Record zones’ menu to get all obtainable zone. And click on the ‘edit’ button for the zone ’emma.io’.

Set Zone name

Click on the ‘Record zones’ menu to get all obtainable zone. And click on the ‘edit’ button for the zone ’emma.io’.

List zones

Now click on the ‘Add document’ button and we efficiently add the DNS zone and DNS document for the area named ’emma.io’.

Subsequent, we will check the area ’emma.io’ utilizing a ‘dig’ DNS utility command.

Verify the title server or ns document of the area ’emma.io’.

dig NS emma.io @10.9.9.10

Check zone with dig command

Verify the A DNS document of the area ’emma.io’.

dig A emma.io @10.9.9.10

dig command result

And you can be displayed the area ’emma.io’ has a nameserver from our DNS server ‘ns1.hakase-labs.io’, and the ‘A’ of that area title is match with our configuration on the highest with server IP deal with ‘10.9.9.11’.

Lastly, the set up and configuration of PowerDNS and Poweradmin on CentOS 7 have been accomplished efficiently.

Google Pixel 3A hands-on: The one Pixel cellphone to purchase

Previous article

Garmin Forerunner 245 Music evaluation: New options, higher worth, few sacrifices

Next article

You may also like

Comments

Leave a reply

Your email address will not be published. Required fields are marked *

More in centos