BOOST_FOREACH(YAML::Node domain, config["domains"]) {
GeoIPDomain dom;
dom.id = s_domains.size();
- dom.domain = domain["domain"].as<string>();
+ dom.domain = DNSName(domain["domain"].as<string>());
dom.ttl = domain["ttl"].as<int>();
for(YAML::const_iterator recs = domain["records"].begin(); recs != domain["records"].end(); recs++) {
format = format2str(format, ip, v6);
// see if the record can be found
- if (dom.records.count(format)) { // return static value
- map<DNSName, vector<DNSResourceRecord> >::iterator i = dom.records.find(format);
+ if (dom.records.count(DNSName(format))) { // return static value
+ map<DNSName, vector<DNSResourceRecord> >::iterator i = dom.records.find(DNSName(format));
BOOST_FOREACH(DNSResourceRecord rr, i->second) {
if (qtype == QType::ANY || rr.qtype == qtype) {
rr.scopeMask = (v6 ? 128 : 32);
soadata.qname = name;
soadata.domain_id = atol(rrow[0].c_str());
- soadata.hostmaster = rrow[1];
+ soadata.hostmaster = DNSName(rrow[1]);
soadata.serial = atol(rrow[2].c_str());
- soadata.nameserver = rrow[3];
+ soadata.nameserver = DNSName(rrow[3]);
soadata.refresh = atol(rrow[4].c_str());
soadata.retry = atol(rrow[5].c_str());
soadata.expire = atol(rrow[6].c_str());
soadata.db = this;
if (d_result.size()>1) {
- L<<Logger::Warning<<backendName<<" Found more than one matching zone for: "+name<<endl;
+ L<<Logger::Warning<<backendName<<" Found more than one matching zone for: "<<name<<endl;
};
return true;
if(!d_qname.empty()) {
// use this to distinguish between select with 'name' field (list()) and one without
- rr.qname=d_qname;
+ rr.qname=DNSName(d_qname);
} else {
string tmpQname = rrow[5];
value = "";
rr.qtype = getString(JSON_GET((*d_result)["result"][d_index], "qtype", value));
- rr.qname = getString(JSON_GET((*d_result)["result"][d_index], "qname", value));
+ rr.qname = DNSName(getString(JSON_GET((*d_result)["result"][d_index], "qname", value)));
rr.qclass = QClass::IN;
rr.content = getString(JSON_GET((*d_result)["result"][d_index], "content",value));
value = -1;
if (this->send(query) == false || this->recv(answer) == false)
return false;
- unhashed = getString(answer["result"]["unhashed"]);
+ unhashed = DNSName(getString(answer["result"]["unhashed"]));
before = getString(answer["result"]["before"]);
after = getString(answer["result"]["after"]);
!answer["result"].HasMember("content"))
throw PDNSException("Invalid response to getTSIGKey, missing field(s)");
- (*algorithm) = getString(answer["result"]["algorithm"]);
+ (*algorithm) = DNSName(getString(answer["result"]["algorithm"]));
content->assign(getString(answer["result"]["content"]));
return true;
struct TSIGKey key;
rapidjson::Value value;
value = "";
- key.name = getString(JSON_GET((*iter), "name", value));
- key.algorithm = getString(JSON_GET((*iter), "algorithm", value));
+ key.name = DNSName(getString(JSON_GET((*iter), "name", value)));
+ key.algorithm = DNSName(getString(JSON_GET((*iter), "algorithm", value)));
key.key = getString(JSON_GET((*iter), "content", value));
if (key.name.empty() ||
value = -1;
// parse return value. we need at least zone,serial,kind
di.id = getInt(JSON_GET(answer["result"],"id",value));
- di.zone = getString(answer["result"]["zone"]);
+ di.zone = DNSName(getString(answer["result"]["zone"]));
if (answer["result"].HasMember("masters") && answer["result"]["masters"].IsArray()) {
rapidjson::Value& value = answer["result"]["masters"];
rapidjson::Value value;
value = "";
rr.qtype = getString(JSON_GET((*d_result)["result"][d_index], "qtype", value));
- rr.qname = getString(JSON_GET((*d_result)["result"][d_index], "qname", value));
+ rr.qname = DNSName(getString(JSON_GET((*d_result)["result"][d_index], "qname", value)));
rr.qclass = QClass::IN;
rr.content = getString(JSON_GET((*d_result)["result"][d_index], "content",value));
value = -1;