Chapter 3. Install and Configure PowerDNS


These steps install PowerDNS, and then configure integration with DNSaaS.

3.1. Install PowerDNS

1. Install but disable the EPEL repository:

# cd /root
# curl -O https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# yum -y install epel-release-7-5.noarch.rpm
# yum-config-manager --disable epel
Copy to Clipboard Toggle word wrap

2. Install the PowerDNS and MySQL backends:

# yum -y --enablerepo=epel install pdns pdns-backend-mysql bind-utils
Copy to Clipboard Toggle word wrap

3. Create the PowerDNS database. Update the IDENTIFIED BY 'ComplexAlphanumericPassword' value to suit your environment.

# mysql -u root << EOF
CREATE DATABASE designate_pdns character set = 'utf8';
GRANT ALL ON designate_pdns.* TO 'designate'@'%' IDENTIFIED BY 'ComplexAlphanumericPassword';
GRANT ALL ON designate_pdns.* TO 'designate'@'localhost' IDENTIFIED BY 'ComplexAlphanumericPassword';
FLUSH PRIVILEGES;
quit
EOF
Copy to Clipboard Toggle word wrap

3.2. Configure PowerDNS

1. Update the local-address and mysql-password values in the /etc/pdns/pdns.conf file to suit your environment:

# General Config
#setgid=pdns
#setuid=pdns
config-dir=/etc/pdns
socket-dir=/var/run
guardian=yes
daemon=no
disable-axfr=no
local-address=192.168.100.20
local-port=53
master=no
slave=yes
cache-ttl=0
query-cache-ttl=0
negquery-cache-ttl=0
# Launch gmysql backend
launch=gmysql
# gmysql parameters
gmysql-host=localhost
gmysql-user=designate
gmysql-password=ComplexAlphanumericPassword
gmysql-dbname=designate_pdns
gmysql-dnssec=yes
logging-facility=0
Copy to Clipboard Toggle word wrap

2. Configure the DNSaaS pool target for PowerDNS:

Note

Remember to update your database password as needed. See the portion containing the string: ComplexAlphanumericPassword

# openstack-config --set /etc/designate/designate.conf pool_target:$target_id type powerdns
# openstack-config --set /etc/designate/designate.conf pool_target:$target_id options "connection: mysql://designate:ComplexAlphanumericPassword@192.168.100.20/designate_pdns?charset=utf8"
# openstack-config --set /etc/designate/designate.conf pool_target:$target_id masters 192.168.100.20:5354
Copy to Clipboard Toggle word wrap

3. Sync your database: This creates the table structure for PowerDNS in its database.

# designate-manage powerdns sync $target_id
Copy to Clipboard Toggle word wrap

4. Restart DNSaaS to apply the pool changes:

# systemctl restart designate-api
# systemctl restart designate-central
# systemctl restart designate-mdns
# systemctl restart designate-pool-manager
# systemctl restart designate-sink
Copy to Clipboard Toggle word wrap

4. Start and enable the PowerDNS service:

# systemctl enable pdns
# systemctl start pdns
Copy to Clipboard Toggle word wrap

5. Test PowerDNS:

# netstat -tap | grep pdns
# netstat -tulpn | grep 53
# dig @192.168.100.20
Copy to Clipboard Toggle word wrap

3.3. Troubleshooting

You can review the DNSaaS logs for any error messages:

# cd /var/log/designate
# tail api.log
# tail central.log
# tail mdns.log
# tail pool-manager.log
# tail sink.log
Copy to Clipboard Toggle word wrap

3.4. Test DNSaaS integration with PowerDNS

1. Create your DNS server record (don’t forget the . at the end of the --name option)

# designate server-list
# designate server-create --name $(hostname).
Copy to Clipboard Toggle word wrap

2. Create a domain (don’t forget the . at the end of the --name option)

# designate domain-list
# designate domain-create --name example.com. --email root@example.com
Copy to Clipboard Toggle word wrap

3. Create a record and test lookup (don’t forget the . at the end of the --name option)

# DOMAINID=$(designate domain-list | grep example.com | awk '{print $2}')
# designate record-create --name server1.example.com. --type A --data 1.2.3.4 $DOMAINID
# dig +short -p 53 @192.168.100.20 server1.example.com A
Copy to Clipboard Toggle word wrap

The DNSaaS Sink listens to Compute and OpenStack Networking notifications, and will take action based on them. You completed the majority of the configuration in the previous steps, however, you need to specify which domain DNSaaS should use for the auto-generation of DNS entries.

1. Modify the DNSaaS configuration for the example domain:

# openstack-config --set /etc/designate/designate.conf handler:nova_fixed domain_id $DOMAINID
# openstack-config --set /etc/designate/designate.conf handler:neutron_floatingip domain_id $DOMAINID
# systemctl restart designate-api
# systemctl restart designate-central
# systemctl restart designate-mdns
# systemctl restart designate-pool-manager
# systemctl restart designate-sink
Copy to Clipboard Toggle word wrap

2. Test Compute (nova) record creation:

Here you will follow a normal nova boot procedure. This step can be performed from the OpenStack Dashboard if preferred. Also, any Image Service (glance) image should work.

This step assumes you have already validated that your OpenStack environment works without DNSaaS. You must already be able to boot instances, assign floating IP addresses, and have functional networking.

# glance image-list
# neutron net-list
# nova boot testserver --flavor m1.tiny --image cirros-0.3.4-x86_64 --key-name yourkey --security-groups default --nic net-id=<Private Net ID>
Copy to Clipboard Toggle word wrap

3. Review the Sink log: Make certain your instance has moved into an active status (using nova list; nova console-log testserver). Once up, you should see a create_record entry if it has picked up the notification correctly.

# tail /var/log/designate/sink.log
Copy to Clipboard Toggle word wrap

Check in PDNS:

# dig +short @192.168.100.20 testserver.example.com
Copy to Clipboard Toggle word wrap

If this test doesn’t work as expected, you can also check directly in the database:

# mysql
use designate_pdns;
show tables;
select * from records;
quit;
Copy to Clipboard Toggle word wrap

Run the command below to test the creation of a floating IP record (replace pubnet1 with a name appropriate for your environment):

# FLOATINGIP=$(neutron floatingip-create pubnet1 | grep floating_ip_address | awk '{print $4}')
# nova add-floating-ip testserver $FLOATINGIP
# DNSRESULT=$(echo $FLOATINGIP |sed 's/\./-/g').example.com
# dig +short @192.168.100.20 $DNSRESULT
Copy to Clipboard Toggle word wrap

You should see a create_record event in the log file:

# tail /var/log/designate/sink.log
Copy to Clipboard Toggle word wrap
Note

It is not currently possible to create floating IP addresses by hostname rather than octets. At present, you can instead create a CNAME against this manually. In a future update it is expected that you will be able to create by hostname.

1. Remove the floating IP address created previously:

# nova remove-floating-ip testserver $FLOATINGIP
Copy to Clipboard Toggle word wrap

You should see a delete_record event in the log:

# tail /var/log/designate/sink.log
Copy to Clipboard Toggle word wrap

And the record should be removed.

2. Remove the testserver created previously:

# designate record-list $DOMAINID
# nova delete testserver
Copy to Clipboard Toggle word wrap

You should see another delete_record event in the log:

# tail /var/log/designate/sink.log
Copy to Clipboard Toggle word wrap

If DNSaaS Sink manages a record it may not be updated manually. There is an option designate --edit-managed record-delete <Domain ID> <Record ID> which was created in Liberty and backported to the Kilo release. However it is not currently available in the generally available release of Red Hat Enterprise Linux OpenStack Platform 7. At present, you will need to manually remove it from your backend DNS and DNSaaS database in the event of any issues.

3.8. Cleanup the PowerDNS configuration

You will not modify the DNSaaS configuration as you will overwrite it when configuring your Bind target.

# SERV1ID=$(designate record-list $DOMAINID| grep server1.example.com | awk '{print $2}')
# designate record-delete $DOMAINID $SERV1ID
# designate domain-delete $DOMAINID
# systemctl disable pdns
# systemctl stop pdns
Copy to Clipboard Toggle word wrap
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat