[Pdns-users] API issue

Peter van Dijk peter.van.dijk at powerdns.com
Tue Nov 24 09:37:21 UTC 2020


(resent from correct account - apologies if my previous email also
appears eventually)

On Sun, 2020-11-22 at 12:24 +0100, Stef Coene via Pdns-users wrote:
> Hi,
> 
> I noticed that you can add a record with no content if you specify a 
> comment.

Not exactly - because there is no 'records' array in your request, the
existing records (if you have any) are untouched. If you have no
test2.test.com/A records, it stays that way. If you had any, they would
also stay.

> We use the mysql backend.
> 
> This API call works and adds an entry to the comments table:
> {
>    "rrsets": [
>      {
>        "name": "test2.test.com.",
>        "type": "A",
>        "ttl": "3600",
>        "comments": [
>          {
>            "content": "Test command",
>            "account": "account 1"
>          }
>        ],
>        "changetype": "REPLACE"
>      }
>    ]
> }
> 
> I was expecting it would fail because there is no matching entry in
the 
> records table.
> 
> Is this normal behaviour?

Yes - comments can exist without records, and records can exist without
comments. This makes sure that your comments do not suddenly disappear
if your records RRset happens to shrink to zero entries.

Kind regards,
-- 
Peter van Dijk
PowerDNS.COM BV - https://www.powerdns.com/



More information about the Pdns-users mailing list