diff options
-rw-r--r-- | data/example.conf | 4 | ||||
-rw-r--r-- | src/config.cpp | 2 | ||||
-rw-r--r-- | src/dns.cpp | 15 |
3 files changed, 14 insertions, 7 deletions
diff --git a/data/example.conf b/data/example.conf index d1fc98087..a91d56e89 100644 --- a/data/example.conf +++ b/data/example.conf @@ -1072,8 +1072,8 @@ dns * SOA record information. */ admin = "admin@example.com" - /* This should be the name of the public facing nameserver serving the records */ - primary_nameserver = "ns1.example.com" + /* This should be the names of the public facing nameserver serving the records */ + nameservers = "ns1.example.com ns2.example.com" /* The time slave servers are allowed to cache. This should be reasonably low * if you want your records to be updated without much delay. */ diff --git a/src/config.cpp b/src/config.cpp index 339a946f5..8969569fd 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -1267,7 +1267,7 @@ ConfigItems::ConfigItems(ServerConfig *conf) {"dns", "ip", "0.0.0.0", new ValueContainerString(&conf->DNSIP), DT_STRING, NoValidation}, {"dns", "port", "53", new ValueContainerInt(&conf->DNSPort), DT_INTEGER, NoValidation}, {"dns", "admin", "admin@example.com", new ValueContainerString(&conf->DNSSOAAdmin), DT_STRING, NoValidation}, - {"dns", "primary_nameserver", "ns1.example.com", new ValueContainerString(&conf->DNSSOANS), DT_STRING, NoValidation}, + {"dns", "nameservers", "ns1.example.com", new ValueContainerString(&conf->DNSSOANS), DT_STRING, NoValidation}, {"dns", "refresh", "3600", new ValueContainerUInt(&conf->DNSSOARefresh), DT_UINTEGER, NoValidation}, {"chanserv", "name", "", new ValueContainerString(&conf->ChanServ), DT_STRING, NoValidation}, {"chanserv", "defaults", "keeptopic secure securefounder signkick", new ValueContainerString(&CSDefaults), DT_STRING, ValidateChanServ}, diff --git a/src/dns.cpp b/src/dns.cpp index e75f98449..ccb919a31 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -468,7 +468,9 @@ unsigned short Packet::Pack(unsigned char *output, unsigned short output_size) unsigned short packet_pos_save = pos; pos += 2; - this->PackName(output, output_size, pos, Config->DNSSOANS); + std::vector<Anope::string> nameservers; + spacesepstream(Config->DNSSOANS).GetTokens(nameservers); + this->PackName(output, output_size, pos, !nameservers.empty() ? nameservers[0] : ""); this->PackName(output, output_size, pos, Config->DNSSOAAdmin.replace_all_cs('@', '.')); if (pos + 20 >= output_size) @@ -730,9 +732,14 @@ bool Manager::HandlePacket(ReplySocket *s, const unsigned char *const packet_buf if (q.type == QUERY_AXFR) { - ResourceRecord rr2(q.name, QUERY_NS); - rr2.rdata = Config->DNSSOANS; - packet->answers.push_back(rr2); + Anope::string token; + spacesepstream sep(Config->DNSSOANS); + while (sep.GetToken(token)) + { + ResourceRecord rr2(q.name, QUERY_NS); + rr2.rdata = token; + packet->answers.push_back(rr2); + } } break; } |