Comments on How to Install PowerDNS and PowerAdmin on Rocky Linux
PowerDNS is a free and open-source DNS Server software. In this guide, we will show you how to install PowerDNS and the PowerDNS-Admin on a Rocky Linux system. We will run the PowerDNS with the MySQL/MariaDB database backend and set up the PowerDNS-Admin that will be used as the web-based management tool for the PowerDNS server.
7 Comment(s)
Comments
Doesn't work for Rocky Linux 9 as the Powertools repository has been changed to CRB. In fact, I have not found a reliable guide to installing Poweradmin on Rocky Linux 9.
change
sudo dnf config-manager --set-enabled powertoolsto
dnf config-manager --enable crb dnf config-manager --enable crbmine cannot find gunicorn :(× powerdns-admin.service - PowerDNS-Admin Loaded: loaded (/etc/systemd/system/powerdns-admin.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Tue 2023-01-31 17:30:25 CET; 8s ago Duration: 3msTriggeredBy: ? powerdns-admin.socket Main PID: 45353 (code=exited, status=203/EXEC) CPU: 11msJan 31 17:30:25 localhost.localdomain systemd[1]: Starting PowerDNS-Admin...Jan 31 17:30:25 localhost.localdomain systemd[1]: Started PowerDNS-Admin.Jan 31 17:30:25 localhost.localdomain systemd[45353]: powerdns-admin.service: Failed to locate executable /usr/local/bin/gunicorn: No such file or directoryJan 31 17:30:25 localhost.localdomain systemd[45353]: powerdns-admin.service: Failed at step EXEC spawning /usr/local/bin/gunicorn: No such file or directoryJan 31 17:30:25 localhost.localdomain systemd[1]: powerdns-admin.service: Main process exited, code=exited, status=203/EXECJan 31 17:30:25 localhost.localdomain systemd[1]: powerdns-admin.service: Failed with result 'exit-code'.
I modified the /etc/systemd/system/powerdns-admin.service file and changed the pat to gunicorn in the "ExecStart" to the full path in the powerdns-admin dir under opt.
Ex: "ExecStart=/opt/powerdns-admin/flask/bin/gunicorn"
Now I am having a problem with Nginx.
Getting a 503 gateway issue and this in the error logs.
2023/07/08 17:27:29 [error] 18394#18394: *6 upstream prematurely closed connection while reading response header from upstream, client: 172.16.150.143, server: pdns.xxxx.net, request: "GET / HTTP/2.0", upstream: "http://unix:/run/powerdns-admin/socket:/", host: "pdns.xxxxx.net"
2023/07/08 17:27:29 [error] 18394#18394: *6 upstream prematurely closed connection while reading response header from upstream, client: 172.16.150.143, server: pdns.xxxxxxx.net, request: "GET /favicon.ico HTTP/2.0", upstream: "http://unix:/run/powerdns-admin/socket:/favicon.ico", host: "pdns.xxxxxx.net", referrer: "https://pdns.xxxxxx.net/"
Still working on that issue..
@hybridblue did you ever figure this out? We're getting the same error as you regarding the upstream client.
For anyone that is still hunting for an answer - here is what I had to do to get this working on Rocky Linux 9.5 as of May 28, 2025
1st - Node 16.x is depricated, I went with:
curl -sL https://rpm.nodesource.com/setup_20.x | bash -
You are also going to need pg_setup which is provided by libpq-deve:dnf install libpq-devel
As of a few weeks ago - xmlsec was breaking all over the place due to some dependency chain issus - the problem can be sovled by forcing the use of v1.3.13:pip install --upgrade --force-reinstall --no-binary lxml xmlsec==1.3.13 xmlsec
You're going to need gunicorn:
pip install gunicorn (I did this as root - not inside the flask)
Once nginx is running but you are getting the gateway error you need to tweak SELinux slightly (EnforcingEverywhere4Life)
audit2allow -a -M nginx-socket ; semodule -i nginx-socket.pp
Everything is wrong with the ownership/permissions of the flask from the SQLite DB to the statically generated assets. I brute forced this problem with:
cd /opt/powerdns-adminfind . -type f | xargs chmod 666find . -type d | xargs chmod 777
Magically everything works after this.
It is likely setting ownership (maybe it needs to be owned by the nginx user/group?) would fix this issue, but I don't expose this jank service to the web (connect to it via SSH tunnel) and I was tired of troubleshooting this tool (a lot of work, but ultimately worth it as it's a nice quality of life improvement)
I have noticed that I occasionally have to run:
rec_control reload-zones
I suspect something isn't firing as expected through the UI. It's only sometimes and luckily my DNS doesn't change that often. Either way that issue is outside the scope of this howto but something to take note of if you add/update a record and are getting a stale record back.
Bear in mind @hybridblue's adjustment above about modifying the systemd service file to look like this:ExecStart=/opt/powerdns-admin/flask/bin/gunicorn --pid /run/powerdns-admin/pid --bind unix:/run/powerdns-admin/socket 'powerdnsadmin:create_app()'