[Pdns-users] webserver api and pdnsutil not in agreement

Curtis Maurand curtis at maurand.com
Tue Oct 14 14:11:45 UTC 2025



On 10/13/25 23:18, Curtis Maurand via Pdns-users wrote:
>
>
> Hello,
>
> I have a pdns authoritative server in production. It is version 4.9.9 
> running on Devuan Daedalus (Debian Bookworm without systemd). It was 
> installed via the powerdns repo. All seems to be working well and will 
> list all zones normally. when I try do something as simple in the api 
> as an export zone I get a 500 error.
>
> When I run
>
> |curl -v -H "X-API-Key: <my api key>"| 
> |http://localhost:8443/api/v1/servers/localhost/zones| 
> <http://localhost:8443/api/v1/servers/localhost/zones/xyonethost.com/export> 
> ||jq .|
>
> |I get a list of zones.
> |
>
> when I run:
>
> |curl -v -H "X-API-Key: <my api key>"| 
> |http://localhost:8443/api/v1/servers/localhost/zones/xyonethost.com/export| 
> <http://localhost:8443/api/v1/servers/localhost/zones/xyonethost.com/export> 
> ||jq .|
>
> I get a 500 error when I try to run that. I check the syslog and I get:
>
> |[webserver] 937b5389-ae14-4ea8-ad57-2b23f18b930b HTTP ISE for 
> "/api/v1/servers/localhost/zones/xyonethost.com/export": STL 
> Exception: Parsing record content (try 'pdnsutil check-zone'): Data 
> field in DNS should start with quote (") at position 0 of 'v=DKIM1; 
> t=s; 
> p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArsfaX8Im/TYQXFicVWzX3AgvWHupQ7AFK10ewMsdAahd40aDdbcOKndApLL6XUg7G21QKGdIhYKSrtRcQOqNwCkfAiFVmoVYLdAZwT0JUd0MYVDGVxy30Tx5NK4S8k7ru//z876wvm9AJgMPLlyt0RRMGSnXdH0PH1pmOCW0ECVCAYMCMlZ69NcB2zsQpjMaRfKjW36C3GYKDmW6Ibg5iw+qE97Nl2BIx4JdirTE32PSyu/mraORgNRiRLJ/6L8VZoCMxcvhxlp6ypl3vHnlou6EF1gkbALLAv9OMJSlwRihI3apzqFtt+7Wf0jmpqNvHOjBbCQZIVJ92XA899++hwIDAQAB'| 
>
>
> |Then I run:|
>
> root at sirius:/etc/powerdns/pdns.d# pdnsutil check-zone xyonethost.com 
> <http://xyonethost.com>
>
> Checked 18 records of 'xyonethost.com', 0 errors, 0 warnings.
>
> This seems to be a bug. I have gone into the database and enclosed the 
> txt record in quotes and that did nothing.
>
> root at sirius:/etc/powerdns/pdns.d# dig txt default._domainkey.xyonethost.com u/localhost +short
>
> returns
>
> |"v=DKIM1; t=s; 
> p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArsfaX8Im/TYQXFicVWzX3AgvWHupQ7AFK10ewMsdAahd40aDdbcOKndApLL6XUg7G21QKGdIhYKSrtRcQOqNwCkfAiFVmoVYLdAZwT0JUd0MYVDGVxy30Tx5NK4S8k7ru//z876wvm9AJgMPLlyt0RRMGSnXdH0PH1pmOCW0ECVCAYMCMlZ69NcB2zsQpjMaRfK" 
> "jW36C3GYKDmW6Ibg5iw+qE97Nl2BIx4JdirTE32PSyu/mraORgNRiRLJ/6L8VZoCMxcvhxlp6ypl3vHnlou6EF1gkbALLAv9OMJSlwRihI3apzqFtt+7Wf0jmpqNvHOjBbCQZIVJ92XA899++hwIDAQAB"|
>
> |the string in the database has no spaces or returns in it. Have I 
> come across a bug or am I missing something stupid?|
>
> |Thanks|
>
>
I tried enclosing all of the text fields in quotes directly in the 
database and that fixed the api and I got the desired output. Another 
problem on the export is that jq didn't understand the output and was 
throwing an error.  I'll have to come up with a query to modify all of 
the txt records.  That's a different discussion. :-)

Thanks for listening,
Curtis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20251014/c6eaa613/attachment.htm>


More information about the Pdns-users mailing list