Description
After a server reboot, the PowerDNS (pdns) service fails to start and enters a crash loop. The logs contain the following error:
Unable to bind to control socket at '/var/run/pdns-domain_com/pdns-domain.com.controlsocket', reason: Permission deniedThis error occurs due to a mismatch in the control socket directory paths. The path is configured differently in the pdns configuration file and in the RuntimeDirectory parameter of the systemd service. As a result, the pdns process cannot find the required directory and crashes because systemd creates and removes its own directory.
Solution
To resolve the issue, synchronize the socket directory path in the pdns configuration with the path created by systemd:
- Connect to the server with the control panel via SSH. For more information about connecting via SSH, see Workstation setup.
-
Check the pdns configuration file:
-
Open the pdns configuration file for your domain, typically located at /etc/powerdns/pdns-domain.com.conf:
cat /etc/powerdns/pdns-domain.com.conf -
Check the value of the
socket-dirparameter:Example outputsocket-dir=/var/run/pdns-domain_com
-
- Compare this value with the path created by systemd:
- Open the systemd service file, typically located at /etc/systemd/system/pdns@domain.com.service:
cat /etc/systemd/system/pdns@domain.com.service - Check the value of the
RuntimeDirectoryparameter:
Example parameterRuntimeDirectory=pdns-%iCommentNoteIn the provided examples, the paths differ. The correct path uses a dot as a separator, not an underscore.
- Open the systemd service file, typically located at /etc/systemd/system/pdns@domain.com.service:
- Fix the mismatch. If the values do not match, edit the pdns configuration file /etc/powerdns/pdns-domain.com.conf and specify the correct value for the
socket-dirparameter:
socket-dir=/var/run/pdns-domain.com - Restart the service:
systemctl restart pdns@domain.com.service - Verify the service status:
systemctl status pdns@domain.com.serviceExpected output indicating an active service.Example outputActive: active (running) since Wed 2025-09-24 10:50:58; 5min ago
Related topics:
En
Es