mirror of
https://github.com/anope/anope.git
synced 2026-07-04 20:33:12 +02:00
Allow services to return more than one NS record
This commit is contained in:
+2
-2
@@ -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.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -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},
|
||||
|
||||
+11
-4
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user