{"id":5892,"date":"2024-11-19T12:34:52","date_gmt":"2024-11-19T18:34:52","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=5892"},"modified":"2024-11-19T12:39:58","modified_gmt":"2024-11-19T18:39:58","slug":"fix-powerdns-old-style-settings-syntax-not-enabled","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/fix-powerdns-old-style-settings-syntax-not-enabled\/","title":{"rendered":"Fix PowerDNS &#8220;Old-style settings syntax not enabled&#8221;"},"content":{"rendered":"\n<p>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 <code>--enable-old-settings<\/code> 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.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-dark-gray-background-color has-text-color has-background has-link-color wp-elements-0b9dfcbd25680876275d6f3d023b4f25\"><code lang=\"bash\" class=\"language-bash\">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\"\n\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code has-white-color has-dark-gray-background-color has-text-color has-background has-link-color wp-elements-469a26f02b2bc494bc19bed2015453c6\"><code lang=\"bash\" class=\"language-bash\">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\"\n\n<\/code><\/pre>\n\n\n\n<p>Fortunately, this is an easy fix.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Convert old config to YAML with <code>rec_control<\/code>.<\/li>\n\n\n\n<li>Save as new YAML config.<\/li>\n\n\n\n<li>Remove old config.<\/li>\n\n\n\n<li>Start pdns-recursor.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Convert Config to YAML<\/h2>\n\n\n\n<p>The <code>rec_control<\/code> command can convert our old style config to a YAML config.  This should automatically pull the default config in <code>\/etc\/pdns-recursor\/recursor.conf<\/code>. <\/p>\n\n\n\n<pre class=\"wp-block-code has-dark-gray-background-color has-background\"><code lang=\"bash\" class=\"language-bash\">rec_control show-yaml<\/code><\/pre>\n\n\n\n<p>Save output to <code>\/etc\/pdns-recursor\/recursor.yml<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Remove the Old Style Config<\/h2>\n\n\n\n<p>We can remove the old config by renaming it, or deleting it.<\/p>\n\n\n\n<pre class=\"wp-block-code has-dark-gray-background-color has-background\"><code lang=\"bash\" class=\"language-bash\">mv \/etc\/pdns-recursor\/recursor.conf \/etc\/pdns-recursor\/recursor.conf.oldstyle<\/code><\/pre>\n\n\n\n<p>Or<\/p>\n\n\n\n<pre class=\"wp-block-code has-dark-gray-background-color has-background\"><code lang=\"bash\" class=\"language-bash\">rm \/etc\/pdns-recursor\/recursor.conf<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Start the PowerDNS Recursor<\/h2>\n\n\n\n<p>Start the <code>pdns-recursor<\/code> service using the <code>systemctl<\/code> command.<\/p>\n\n\n\n<pre class=\"wp-block-code has-dark-gray-background-color has-background\"><code lang=\"bash\" class=\"language-bash\">sudo systemctl start pdns-recursor<\/code><\/pre>\n\n\n\n<p>Verify there are no errors<\/p>\n\n\n\n<pre class=\"wp-block-code has-dark-gray-background-color has-background\"><code lang=\"bash\" class=\"language-bash\">sudo systemctl status pdns-recursor<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Further Reading.<\/p>\n\n\n\n<p><a href=\"https:\/\/doc.powerdns.com\/recursor\/yamlsettings.html\">https:\/\/doc.powerdns.com\/recursor\/yamlsettings.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8211;enable-old-settings is provided as a command line option when starting PowerDNS. If that option &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/fix-powerdns-old-style-settings-syntax-not-enabled\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,3],"tags":[277,7,1279,1713,1278,1715,1714],"class_list":["post-5892","post","type-post","status-publish","format-standard","hentry","category-dns","category-linux","tag-dns","tag-linux-2","tag-pdns","tag-pdns-recursor","tag-powerdns","tag-yaml","tag-yml"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=5892"}],"version-history":[{"count":8,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5892\/revisions"}],"predecessor-version":[{"id":5900,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5892\/revisions\/5900"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=5892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=5892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=5892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}