025-pdns-server-installation-02

PowerDNS is a DNS that is free server runs on most Linux systems. It supports type that is different of to keep the area files, from BIND-style text files to relational databases particularly MySQL. Additionally separates respected DNS host functions, for hosting names of domain, and query that is recursive into two different processes. The article below contains step-by-step instructions on how to install PowerDNS as an DNS that is authoritative server servers operating Ubuntu operating-system, making use of MySQL database because the backend.

that which we must Prepare

You need a server that is physical a virtual machine running Ubuntu operating systems. It’s advisable to use the most LTS that are recentlong haul help) variations of Ubuntu, particularly Ubuntu 16.04 LTS or Ubuntu 14.04 LTS. Below directions are derived from a machine that is virtual Ubuntu 14.04 LTS system that is operating in SimplerCloud. Since root account had been utilized, sudo demand had been omitted of all associated with the actions. If you work with a user that is non-root sudo access on an Ubuntu environment, please append sudo in front of each command (e.g. sudo apt-get update instead of apt-get update).

Patching the Operating System

First step, let’s ensure that the latest Ubuntu operating system’s kernel and patches are installed on the server.

apt-get update
 apt-get dist-upgrade -y

001-apt-get-update-01

002-apt-get-update-02

003-apt-get-dist-upgrade

Reboot the system once done, and run another apt-get dist-upgrade****************) that is-y to ensure there are not any more spots must be set up.

sync
 reboot

004-sync-reboot

005-another-apt-get-dist-upgrade-to-verify

Once we now have verified your latest kernel variation and spots have already been set up, we could then proceed to another step.

Installation of MySQL

PowerDNS need database to keep the area files, although you may also make use of text files just like BIND. With this guide, we are MySQL that is using database the backend. We need to install MySQL server first before we install PowerDNS. Let’s install MySQL through below demand:

apt-get install mysql-server

006-apt-get-install-mysql-server

Type “y” to keep. Through the MySQL Server installation, you shall be prompted for the MySQL root password. Key in the root that is preferred and save your self the password in a safe spot for future usage.

010-key-in-mysql-root-password

Key within the root password once more for verification.

011-repeat-mysql-root-password

012-continue-apt-get-install-mysql-server-01

013-continue-apt-get-install-mysql-server-02

After MySQL Server is set up, we must alter the settings to help make MySQL pay attention on all internet protocol address details and interfaces, instead of just localhost. Make use of your favourite text that is linux-based such as vi or nano to open the MySQL configuration file: /etc/mysql/my.cnf.

vi /etc/mysql/my.cnf

014-vi-etc-mysql-my-cnf

Look for these lines below:

# Instead of skip-networking the default is now to listen only on
 # localhost which is more compatible and is not less &# that is secure*****************************************************************************************************************************************************************************************************************************************************************************************************************************************); bind-address = 127.0.0.1

and remark out of the “bind-address” line so that it can be such as this:

# in place of skip-networking the standard has become to pay attention just on
 # localhost which will be more appropriate and it is maybe not less &# that is secure*****************************************************************************************************************************************************************************************************************************************************************************************************************************************); #bind-address = 127.0.0.1

Save the file, and then restart MySQL service for the changes to take effect.

service mysql restart

016-service-mysql-restart

Installation of PowerDNS

After MySQL is installed, then we can install PowerDNS. There are two packages we need to install: the PowerDNS package itself (pdns-server) and the MySQL backend for PowerDNS (pdns-backend-mysql).

apt-get install pdns-server pdns-backend-mysql

017-apt-get-install-pdns-server

Press “y” to continue. During the installation process, you shall be prompted to configure database for pdns-backend-mysql with dbconfig-common. Choose “Yes”.

020-configuring-pdns-backend-mysql

Key within the root password — usually the one you set on previous actions — on prompt that is next

021-key-in-mysql-root-password

On the step that is next you need to input a brand new password, which is useful for pdns-backend-mysql to join up with all the database host. This is often not the same as the basis password you've got set above. Please make sure you set in a safe place.( that you save the password*****)

022-set-password-for-pdns-backend-mysql

Key in the password again.

023-key-in-the-password-again

Wait until the PowerDNS installation is completed.

024-pdns-server-installation-01

025-pdns-server-installation-02

Voila! The PowerDNS has been installed.

Creation of PowerDNS Database, User and Tables

Once PowerDNS has been installed, we need to create the database, user and tables required for PowerDNS to run. We need to invoke the MySQL client on the server by running below command:

mysql -u root -p

Key in the MySQL root password you have set on the earlier section of this tutorial.

026-go-into-mysql-client-prompt

Next, let us prepare the MySQL commands we will be using to create the PowerDNS database, user, tables and all the privileges that are necessary. Here you will find the commands:

CREATE DATABASE powerdns;
 
 GIVE each ON powerdns.* TO 'powerdnsuser'@'localhost' IDENTIFIED with 'powerdns-password';
 
 FLUSH PRIVILEGES;
 
 utilize powerdns;
 
 CREATE TABLE domains (
 id INT auto_increment,
 title VARCHAR(255) never NULL,
 master VARCHAR(128) DEFAULT NULL,
 last_check INT DEFAULT NULL,
 kind VARCHAR(6) never NULL,
 notified_serial INT DEFAULT NULL,
 account VARCHAR(40) DEFAULT NULL,
 main key (id)
 );
 
 CREATE ORIGINAL INDEX name_index ON domains(name);
 
 CREATE TABLE documents (
 id INT auto_increment,
 domain_id INT DEFAULT NULL,
 title VARCHAR(255) DEFAULT NULL,
 kind VARCHAR(6) DEFAULT NULL,
 content VARCHAR(255) DEFAULT NULL,
 ttl INT DEFAULT NULL,
 prio INT DEFAULT NULL,
 change_date INT DEFAULT NULL,
 main key(id)
 );
 
 CREATE INDEX rec_name_index ON records(name);
 
 CREATE INDEX nametype_index ON records(name,type);
 
 CREATE INDEX domain_id ON records(domain_id);
 
 CREATE TABLE supermasters (
 internet protocol address VARCHAR(25) never NULL,
 nameserver VARCHAR(255) never NULL,
 account VARCHAR(40) DEFAULT NULL
 );

Note that powerdns may be the title associated with the database we are making use of. powerdnsuser may be the MySQL username we are making use of for PowerDNS, while powerdns-password may be the password. For protection explanation, please replace the password to a much more powerful password.

what can be done should duplicate and paste most of the lines that are above the mysql> prompt. Let us copy and rather paste per section than every thing in general. Let’s begin.

027-create-database-powerdns

Once after every one of the tables and indexes have already been produced, kind q to give up the MySQL prompt and get back to the Linux / Ubuntu prompt.

028-quit-mysql-client

Configure PowerDNS

Next, we must configure PowerDNS to utilize the MySQL database which we now have ready. Visit /etc/powerdns/pdns.d folder and eliminate most of the configuration that is existing we have there. Alternatively, we can move the files to another place that is safe back-up.

cd /etc/powerdns/pdns.d #go toward /etc/powerdns/pdns.d folder
 ls -la #check what is within the folder
 rm /etc/powerdns/pdns.d/* #remove the present files on folder
 ls -la #verify your files have already been eliminated

029-remove-existing-powerdns-config-files

Use your text that is favourite editornano or vi) to create a new /etc/powerdns/pdns.d/pdns.local.gmysql.conf with following content*****) that is:(**********)# MySQL Configuration # # release gmysql backend launch=gmysql # gmysql parameters gmysql-host=localhost gmysql-dbname=powerdns gmysql-user=powerdnsuser gmysql-password=powerdns-password

030-vi-pdns-local-gmysql-conf

031-content-of-pdns-local-gmysql-conf

Save the file, and restart pdns solution.

service pdns restart

032-service-pdns-restart

To verify your pdns solution is operating:

service pdns status

033-service-pdns-status

And to confirm your PowerDNS DNS host should indeed be operating on the host, we could make use of the dig demand:

dig @localhost

034-dig-localhost

(it’s recommended to use the PowerAdmin web-based control panel for PowerDNS***)That’s it, PowerDNS DNS server is already running and ready to use.

To use PowerDNS and manage the zone records to be hosted on the DNS server. We shall cover the step-by-step instructions on how to install PowerAdmin on a separate article that is tutorial

Disclaimer : this really is another guest that is great article by Indra Pramana from SimplerCloud.com, a cloud servers provider from Singapore with solutions built through the ground as much as offer really real-time, scalable and simply managed cloud infrastructure for start-ups, designers and company throughout Asia.

LEAVE A REPLY

Please enter your comment!
Please enter your name here