::arg().setSwitch("prevent-self-notification", "Don't send notifications to what we think is ourself") = "yes";
::arg().setSwitch("any-to-tcp", "Answer ANY queries with tc=1, shunting to TCP") = "yes";
::arg().setSwitch("edns-subnet-processing", "If we should act on EDNS Subnet options") = "no";
+ ::arg().set("delay-notifications", "Configure a delay to send out notifications, no delay by default") = "0";
::arg().set("edns-cookie-secret", "When set, set a server cookie when responding to a query with a Client cookie (in hex)") = "";
::arg().set("rng", "Specify the random number generator to use. Valid values are auto,sodium,openssl,getrandom,arc4random,urandom.") = "auto";
::arg().set("default-catalog-zone", "Catalog zone to assign newly created primary zones (via the API) to") = "";
+
#ifdef ENABLE_GSS_TSIG
::arg().setSwitch("enable-gss-tsig", "Enable GSS TSIG processing") = "no";
#endif
for (const auto& ip : ips) {
g_log << Logger::Notice << "Queued notification of domain '" << di.zone << "' to " << ip << endl;
- d_nq.add(di.zone, ip);
+ d_nq.add(di.zone, ip, d_delayNotifications);
hasQueuedItem = true;
}
}
g_log << Logger::Notice << "Queued also-notification of domain '" << di.zone << "' to " << caIp.toStringWithPort() << endl;
if (!ips.count(caIp.toStringWithPort())) {
ips.insert(caIp.toStringWithPort());
- d_nq.add(di.zone, caIp.toStringWithPort());
+ d_nq.add(di.zone, caIp.toStringWithPort(), d_delayNotifications);
}
hasQueuedItem = true;
}
d_preventSelfNotification = ::arg().mustDo("prevent-self-notification");
+ auto delay = ::arg().asNum("delay-notifications");
+ if (delay > 0) {
+ d_delayNotifications = static_cast<time_t>(delay);
+ }
+
try {
d_onlyNotify.toMasks(::arg()["only-notify"]);
}
class NotificationQueue
{
public:
- void add(const DNSName &domain, const string &ip)
+ void add(const DNSName &domain, const string &ip, time_t delay = 0)
{
const ComboAddress caIp(ip);
nr.ip = caIp.toStringWithPort();
nr.attempts = 0;
nr.id = dns_random_uint16();
- nr.next = time(0);
+ nr.next = time(nullptr) + delay;
d_nqueue.push_back(nr);
}
time_t d_tickinterval;
bool d_secondarieschanged;
bool d_preventSelfNotification;
+ time_t d_delayNotifications{0};
struct Data
{