The PowerDNS Recursor started supporting YAML for configs in version 5.0.0. YAML is the default as of 5.2.0. You can still use the old config if --enable-old-settings
is provided as a command line option when starting PowerDNS. If that option is not being used, and you are using the old config, you will experience the following errors.
msg="Old-style settings syntax not enabled by default anymore. Use YAML or enable with --enable-old-settings on the command line" subsystem="config" level="0" prio="Error" tid="0" ts="1732025541.126" configname="/etc/pdns-recursor/recursor.conf"
msg="YAML config found, but error occurred processing it" error="invalid type: string \"allow-from=127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16", expected struct Recursorsettings at line 17 column 1" subsystem="config" level="0" prio="Error" tid="0" ts="1732025541.817" configname="/etc/pdns-recursor/recursor.conf"
Fortunately, this is an easy fix.
- Convert old config to YAML with
rec_control
. - Save as new YAML config.
- Remove old config.
- Start pdns-recursor.
Convert Config to YAML
The rec_control
command can convert our old style config to a YAML config. This should automatically pull the default config in /etc/pdns-recursor/recursor.conf
.
rec_control show-yaml
Save output to /etc/pdns-recursor/recursor.yml
Remove the Old Style Config
We can remove the old config by renaming it, or deleting it.
mv /etc/pdns-recursor/recursor.conf /etc/pdns-recursor/recursor.conf.oldstyle
Or
rm /etc/pdns-recursor/recursor.conf
Start the PowerDNS Recursor
Start the pdns-recursor
service using the systemctl
command.
sudo systemctl start pdns-recursor
Verify there are no errors
sudo systemctl status pdns-recursor
Further Reading.