Catalog Zone (RFC TBD)
=======================
-Starting with the PowerDNS Authoritative Server 4.7.0, catalog zone support is available. The current supported catalog version is "2". All all the important features of catalog zones are supported. There are however a few properties where support is limited:
+Starting with the PowerDNS Authoritative Server 4.7.0, catalog zone support is available.
+
+Supported catalog versions
+--------------------------
+
++-----------------+----------+----------+
+| Catalog version | Producer | Consumer |
++=================+==========+==========+
+| 1 (ICS) | No | Yes |
++-----------------+----------+----------+
+| 2 (RFC TBD) | Yes | Yes |
++-----------------+----------+----------+
+
+All all the important features of catalog zone version "2" are supported. There are however a few properties where support is limited:
- There is no support for group templates on consumers;
- There is no support for custom extensions;
// From XFR
bool hasSOA{false};
- bool hasVersion{false};
bool zoneInvalid{false};
+ int hasVersion{0};
CatalogInfo ci;
}
else if (rr.qname == DNSName("version") + di.zone && rr.qtype == QType::TXT) {
- if (rr.content == "\"2\"") {
- hasVersion = true;
- continue;
+ if (hasVersion) {
+ g_log << Logger::Warning << logPrefix << "zone '" << di.zone << "', multiple version records found, aborting" << endl;
+ return false;
+ }
+
+ if (rr.content == "\"1\"") {
+ hasVersion = 1;
+ }
+ else if (rr.content == "\"2\"") {
+ hasVersion = 2;
}
else {
g_log << Logger::Warning << logPrefix << "zone '" << di.zone << "', unsupported catalog zone schema version " << rr.content << ", aborting" << endl;
}
}
- else if (rel == (DNSName("coo") + unique) && rr.qtype == QType::PTR) {
- if (!ci.d_coo.empty()) {
- g_log << Logger::Warning << logPrefix << "zone '" << di.zone << "', duplicate COO for unique '" << unique << "'" << endl;
- zoneInvalid = true;
- }
- else {
- ci.d_coo = DNSName(rr.content);
+ else if (hasVersion == 2) {
+ if (rel == (DNSName("coo") + unique) && rr.qtype == QType::PTR) {
+ if (!ci.d_coo.empty()) {
+ g_log << Logger::Warning << logPrefix << "zone '" << di.zone << "', duplicate COO for unique '" << unique << "'" << endl;
+ zoneInvalid = true;
+ }
+ else {
+ ci.d_coo = DNSName(rr.content);
+ }
}
- }
- else if (rel == (DNSName("group") + unique) && rr.qtype == QType::TXT) {
- std::string content = rr.content;
- if (content.length() >= 2 && content.at(0) == '\"' && content.at(content.length() - 1) == '\"') { // TXT pain
- content = content.substr(1, content.length() - 2);
+ else if (rel == (DNSName("group") + unique) && rr.qtype == QType::TXT) {
+ std::string content = rr.content;
+ if (content.length() >= 2 && content.at(0) == '\"' && content.at(content.length() - 1) == '\"') { // TXT pain
+ content = content.substr(1, content.length() - 2);
+ }
+ ci.d_group.insert(content);
}
- ci.d_group.insert(content);
}
}
rr.disabled = true;