How to Install and Configure ‘PowerDNS’ (with MariaDB) and ‘PowerAdmin’ in RHEL/CentOS 7

Step 2: Installing PowerAdmin to Manage PowerDNS

11. Now we will install PowerAdmin – a friendly web interface designed to manager PowerDNS servers. Since it is written in PHP, we will need to install PHP and a web server (Apache):

# yum 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
Install Apache PHP

Install Apache PHP

PowerAdmin also requires two PEAR packages:

# yum -y install php-pear-DB php-pear-MDB2-Driver-mysql 
Install Pear

Install Pear

You can also refer to the following article for complete instructions how to install LAMP stack in CentOS 7:

  1. Install LAMP in CentOS 7

Once the install is complete, we will need to start and set Apache to start at system boot:

# systemctl enable httpd.service
# systemctl start httpd.service
Enable Start Apache System Boot

Enable Start Apache System Boot

12. Now that all system requirements for running PowerAdmn are met, we can proceed and download the package. Since the default web directory for Apache is /var/www/html/, we will download the package in there.

# cd /var/www/html/
# wget http://downloads.sourceforge.net/project/poweradmin/poweradmin-2.1.7.tgz 
# tar xfv poweradmin-2.1.7.tgz
Download PowerAdmin

Download PowerAdmin

13. Now, we can now start the web installer of PowerAdmin. Simply open:

http://192.168.0.102/poweradmin-2.1.7/install/

This should bring the first step of the installation:

Select Installation Language

Select Installation Language

The above page will ask you to choose the language for your PowerAdmin. Select the one you wish to use and click the “Go to step 2” button.

14. The installer will expect you to have a PowerDNS database:

PowerDNS Database

PowerDNS Database

15. Since we already created one, we can proceed to the next step. You will be asked to enter the database details you setup earlier. You will also need to setup Poweradmin administrator password:

Enter PowerDNS Database Settings

Enter PowerDNS Database Settings

16. Once you have input those, go to step 4. You will create a new user with a limited rights for Poweradmin. The fields that you need to enter here are:

  1. Username – username for the PowerAdmin.
  2. Password – password for the above user.
  3. Hostmaster – When creating SOA records and you have not specified hostmaster, this value will be used.
  4. Primary nameserver – the value will be used as primary name server when creating new DNS zones.
  5. Secondary nameserver – the value will be used as primary name server when creating new DNS zones.
PowerDNS Configuration Settings

PowerDNS Configuration Settings

17. On the next step Poweradmin will ask you to create new database user with limited rights on the database tables. It will provide you with the code that you will need to put in a MySQL console:

Create New Database User

Create New Database User

18. Now open a terminal and run:

# mysql -u root -p

Provide your password and execute the code provided by Poweradmin:

MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE
ON powerdns.*
TO 'powermarin'@'localhost'
IDENTIFIED BY '123qweasd';
Grant Mysql Permissions to User

Grant Mysql Permissions to User

19. Now go back to your browser and proceed to the next step. The installer will attempt to create its configuration file in /var/www/html/poweradmin-2.1.7/inc.

The file name is config.inc.php. In case the script is not able to write that file you can create it manually by copying the text and putting it in above mentioned file:

Configuration Settings of PowerDNS

Configuration Settings of PowerDNS

20. Now go to the last page where you will be informed that the installation is complete and will receive information how to access your Poweradmin install:

PowerDNS Installation Completed

PowerDNS Installation Completed

You can enable URLs used by other dynamic DNS providers by running:

# cp install/htaccess.dist .htaccess 

For that purpose you will need to have mod_rewrite enabled in Apache’s configuration.

21. Now it is important to remove the “install” folder from Poweradmin’s root directory with the following command:

# rm -fr /var/www/html/poweradmin/install/

After that you can access your poweradmin at:

http://192.168.0.102/poweradmin-2.1.7/
PowerDNS Login

PowerDNS Login

After logging you should see the Poweradmin main page:

PowerDNS Dashboard

PowerDNS Dashboard

At this point your installation is complete and you are now ready to start managing your DNS zones.

Step 3: How to Add, Edit and Delete DNS Zones in PowerDNS

22. To add new master zone, simply click on the “Add master zone”:

Add Master Zone

Add Master Zone

On the next page there are few things that you need to fill:

  1. Domain – domain for which you will be adding the zone.
  2. Owner – sets the owner of the DNS zone.
  3. Template – DNS template – leave to none.
  4. DNSSEC – Donany Name System Security Extensions (optional -check if you need it).

Click the “Add zone” button to add the DNS zone.

Master DNS Zone

Master DNS Zone

Now you can go back to the index page of Poweradmin by clicking the “Index” link. To review all existing DNS zones simply go to “List zones”:

Check List of Zones

Check List of Zones

You should now see a list of available DNS zones:

Check List of DNS Zones

Check List of DNS Zones

23. To edit an existing DNS zone or add new records click the edit icon:

Edit DNS Zone

Edit DNS Zone

On the next page you will see the entries for the DNS zone you have chosen:

Domain DNS Zone Entries

Domain DNS Zone Entries

24. In here to add new DNS zone you will need to set the following information:

  1. Name – name for the entry. Only add the first part of the domain/subdomain, the rest will be added by Poweradmin.
  2. Type – choose the record type.
  3. Priority – priority of the record.
  4. TTL – Time To Live in seconds.

For the purpose of this article, I will add an A record for subdomain new.example.com that will resolve on IP address 192.168.0.102 with time to live 14400 seconds:

Add New DNS Record

Add New DNS Record

Finally click the “Add record” button.

25. If you wish to delete a DNS zone you can go back to the “List zone” page and click on the “Trash” icon next to the DNS zone which you wish to delete:

Delete DNS Zone

Delete DNS Zone

Poweradmin will ask you if you are sure you want to delete the DNS zone. Simply click “Yes” to finish the deletion.

For more detailed instructions how to create, edit and delete zones you can refer to Poweradmin’s documentation at:

https://github.com/poweradmin/poweradmin/wiki/Documentation

I hope you have find this article interesting and useful. As always if you have any questions or comments please do not hesitate to submit them in the comment section below.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Marin Todorov

I am a bachelor in computer science and a Linux Foundation Certified System Administrator. Currently working as a Senior Technical support in the hosting industry. In my free time I like testing new software and inline skating.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide
The Complete Linux System Administrator Bundle
Become an Ethical Hacker Bonus Bundle

You may also like...

16 Responses

  1. Garett says:

    Excellent article. Unlike anything, I was able to find anywhere else. Thanks so much!

    One suggestion I would give to everyone is to determine what PDNS version you have by paying attention to the version number after the yum command. If you are already past that point, run the following command:

    # pdns_control version
    

    Then go to the official website to download the schema that matches the same version that is installed on your system. In my case, I kept using the wrong schema and caused me more frustration than necessary. The schema seems to change between each incremental release and is not forward or backward compatible.

Got something to say? Join the discussion.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.