:property [RRSet] rrsets: RRSets in this zone
:property [str] servers: For zones of type "Forwarded", addresses to send the queries to
:property bool recursion_desired: For zones of type "Forwarded", Whether or not the RD bit should be set in the query
+ :property bool notify_allowed: For zones of type "Forwarded", Whether or not to permit incoming NOTIFY to wipe cache for the domain
To properly process new zones, the following conditions must
be true:
string singleIPTarget = document["single_target_ip"].string_value();
string kind = toUpper(stringFromJson(document, "kind"));
bool rdFlag = boolFromJson(document, "recursion_desired");
+ bool notifyAllowed = boolFromJson(document, "notify_allowed", false);
string confbasename = "zone-" + apiZoneNameToId(zone);
const string yamlAPiZonesFile = ::arg()["api-config-dir"] + "/apizones";
pdns::rust::settings::rec::ForwardZone forward;
forward.zone = zonename;
forward.recurse = rdFlag;
- forward.notify_allowed = false;
+ forward.notify_allowed = notifyAllowed;
for (const auto& value : document["servers"].array_items()) {
forward.forwarders.emplace_back(value.string_value());
}
throw ApiException("Need at least one upstream server when forwarding");
}
+ const string notifyAllowedConfig = notifyAllowed ? "\nallow-notify-for+=" + zonename : "";
if (rdFlag) {
- apiWriteConfigFile(confbasename, "forward-zones-recurse+=" + zonename + "=" + serverlist);
+ apiWriteConfigFile(confbasename, "forward-zones-recurse+=" + zonename + "=" + serverlist + notifyAllowedConfig);
}
else {
- apiWriteConfigFile(confbasename, "forward-zones+=" + zonename + "=" + serverlist);
+ apiWriteConfigFile(confbasename, "forward-zones+=" + zonename + "=" + serverlist + notifyAllowedConfig);
}
}
}