Bobcares

Powerdns Installation in Ubuntu 20.04

by | May 5, 2022

PowerDNS installation in ubuntu 20.04 will allow us to use an authoritative nameserver that is free and open-source. It performs exceptionally well in terms of domain resolution.

As part of our Server Management, Bobcares provides solutions for every query.

Let’s take a look at how one of our customers used our Skilled engineers to install PowerDN in Ubuntu 20.04.

PowerDNS installation in ubuntu 20.04

PowerDNS is an authoritative nameserver that is both free and open-source. It’s written in C++ and runs on Unix, Linux, and MacOS. Zone files and records are stored in MySQL, MariaDB, PostgreSQL, and Oracle databases.

PowerDNS;

  • supports a wide range of different backends, from simple zonefiles to relational databases and load balancing/failover algorithms
  • provides enhanced security features
  • Because its source code is relatively small, auditing is simple.
  • It provides a wealth of statistics on its operation, which is helpful to determine the scalability of an installation as well as identifying problems.

Install and Configure MariaDB Server

Installing the MariaDB database server on our system is required before we begin. The default repository in Ubuntu 20.04 does not have the most recent version of MariaDB. As a result, we’ll need to configure our system to include the MariaDB repository.

First, run the following command to install the required packages:
apt-get install software-properties-common gnupg2 -y

Once all of the packages have been installed, run the following command to add the MariaDB signing key:
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'

Then, with the following command, add the MariaDB repository:
add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirrors.ukfast.co.uk/sites/mariadb/repo/10.5/ubuntu focal main'

Next, run the following command to install the MariaDB server:
apt-get install mariadb-server -y

We’ll need to create a database and a user for PowerDNS once it’s installed.

To begin, run the following command to connect to MariaDB:
mysql

After we’ve logged in, run the following command to create a database and user:

MariaDB [(none)]> create database pdns;
MariaDB [(none)]> grant all on pdns.* to pdnsadminbobcares@localhost identified by 'BoBc@respassword';

Then, with the following command, flush the privileges and exit the MariaDB shell:

MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

Install PowerDNS

To begin, we must disable the systemd-resolved service on our system. With the following command, we can turn it off:
systemctl disable --now systemd-resolved

Next, delete the default resolv.conf file and replace it with the following:

rm -rf /etc/resolv.conf
echo "nameserver 8.8.8.8" > /etc/resolv.conf

Next, run the following command to set up the PowerDNS server:
apt-get install pdns-server pdns-backend-mysql -y

After we’ve installed PowerDNS, we can move on to the next step.

Configure PowerDNS

The PowerDNS database schema must first be imported into the PowerDNS database. We can use the following command to import it:
mysql -u pdnsadmin -p pdns < /usr/share/pdns-backend-mysql/schema/schema.mysql.sql

The PowerDNS database connection details must then be defined. We can do so by editing the pdns.local.gmysql.conf file as follows:
vim /etc/powerdns/pdns.d/pdns.local.gmysql.conf

The following lines should be changed:

# MySQL Configuration
#
# Launch gmysql backend
launch+=gmysql

# gmysql parameters
gmysql-host=127.0.0.1
gmysql-port=3306
gmysql-dbname=pdns
gmysql-user=pdnsadminbobcares
gmysql-password=BoBc@respassword
gmysql-dnssec=yes
# gmysql-socket=

Save and close the file, then give the file pdns.local.gmysql.conf the following permissions:
chmod 640 /etc/powerdns/pdns.d/pdns.local.gmysql.conf

Then, with the following command, stop the PowerDNS server and verify the PowerDNS:

systemctl stop pdns
pdns_server --daemon=no --guardian=no --loglevel=9

Then, with the following command, start the PowerDNS server:
systemctl start pdns

PowerDNS is now up and running, listening on port 53. We can run the following command to see if it’s true:
ss -alnp4 | grep pdns

[Looking for a solution to another query? We are just a click away.]

Conclusion

To sum up, our skilled support engineers at Bobcares demonstrated how to install PowerDNS in Ubuntu 20.04.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

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

Never again lose customers to poor
server speed! Let us help you.