tuxis-ie / nsedit

DNS Editor working with PowerDNS's new API
GNU General Public License v2.0
198 stars 55 forks source link

INCEPTION-INCREMENT is not a valid option for soa_edit_api #189

Open stecklars opened 4 years ago

stecklars commented 4 years ago

INCEPTION-INCREMENT is not a valid option for soa_edit_api, see: https://doc.powerdns.com/authoritative/domainmetadata.html#soa-edit-api

-> "These rules are the same as the SOA-EDIT-DNSUPDATE rules." --> https://doc.powerdns.com/authoritative/dnsupdate.html#dnsupdate-soa-serial-updates ---> There is no "INCEPTION-INCREMENT" Setting.

Since 4.2 this is more strictly checked by PowerDNS: https://github.com/PowerDNS/pdns/commit/636301b9f15aa5eecab4282258e85503b7ea4dcf#diff-fcc782f1cdc22f79be390c5d65da9050

Before this, it would simply use the DEFAULT option, now it logs an error and doesn't increase the Serial: "SOA-EDIT-API/DNSUPDATE type 'INCEPTION-INCREMENT' for zone myzone.com is unknown."

Setting this to DEFAULT will therefore, as PowerDNS simply fell back to DEFAULT before, keep expected behaviour.

stecklars commented 4 years ago

I fixed existing zones with

#!/bin/bash

ALLZONES=$(/usr/bin/pdnsutil list-all-zones)

while read -r ZONE; do
        /usr/bin/pdnsutil get-meta $ZONE | grep 'SOA-EDIT-API = INCEPTION-INCREMENT' > /dev/null
        if [ $? -eq 0 ]; then
                echo "Fixing $ZONE..."
                /usr/bin/pdnsutil set-meta $ZONE SOA-EDIT-API DEFAULT
        fi
done <<< "$ALLZONES"

(This might help someone)