From: Kees Monshouwer Date: Tue, 6 Dec 2022 17:29:16 +0000 (+0100) Subject: auth: api, do not create SOA and NS records for consumer zones X-Git-Tag: dnsdist-1.8.0-rc1~186^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f1674ed5ed14af10a6ce38b9956ffdbef6fcee8;p=thirdparty%2Fpdns.git auth: api, do not create SOA and NS records for consumer zones --- diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 419cdc03c7..8342d5af36 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -1705,7 +1705,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) { throw ApiException("You cannot give rrsets AND zone data as text"); auto nameservers = document["nameservers"]; - if (!nameservers.is_null() && !nameservers.is_array() && zonekind != DomainInfo::Slave) + if (!nameservers.is_null() && !nameservers.is_array() && zonekind != DomainInfo::Slave && zonekind != DomainInfo::Consumer) throw ApiException("Nameservers is not a list"); // if records/comments are given, load and check them @@ -1755,7 +1755,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) { autorr.auth = true; autorr.ttl = ::arg().asNum("default-ttl"); - if (!have_soa && zonekind != DomainInfo::Slave) { + if (!have_soa && zonekind != DomainInfo::Slave && zonekind != DomainInfo::Consumer) { // synthesize a SOA record so the zone "really" exists string soa = ::arg()["default-soa-content"]; boost::replace_all(soa, "@", zonename.toStringNoDot());