#ifdef HAVE_LUA_RECORDS
bool g_doLuaRecord;
int g_luaRecordExecLimit;
+time_t g_luaHealthChecksInterval{5};
+time_t g_luaHealthChecksExpireDelay{3600};
#endif
typedef Distributor<DNSPacket,DNSPacket,PacketHandler> DNSDistributor;
#ifdef HAVE_LUA_RECORDS
::arg().setSwitch("enable-lua-records", "Process LUA records for all zones (metadata overrides this)")="no";
::arg().set("lua-records-exec-limit", "LUA records scripts execution limit (instructions count). Values <= 0 mean no limit")="1000";
+ ::arg().set("lua-health-checks-expire-delay", "Stops doing health checks after the record hasn't been used for that delay (in seconds)")="3600";
+ ::arg().set("lua-health-checks-interval", "LUA records health checks monitoring interval in seconds")="5";
#endif
::arg().setSwitch("axfr-lower-serial", "Also AXFR a zone from a master with a lower serial")="no";
"', do = " <<question.d_dnssecOk <<", bufsize = "<< question.getMaxReplyLen();
if(question.d_ednsRawPacketSizeLimit > 0 && question.getMaxReplyLen() != (unsigned int)question.d_ednsRawPacketSizeLimit)
g_log<<" ("<<question.d_ednsRawPacketSizeLimit<<")";
- g_log<<": ";
}
if(PC.enabled() && (question.d.opcode != Opcode::Notify && question.d.opcode != Opcode::Update) && question.couldBeCached()) {
bool haveSomething=PC.get(question, cached); // does the PacketCache recognize this question?
if (haveSomething) {
if(logDNSQueries)
- g_log<<"packetcache HIT"<<endl;
+ g_log<<": packetcache HIT"<<endl;
cached.setRemote(&question.d_remote); // inlined
cached.setSocket(question.getSocket()); // inlined
cached.d_anyLocal = question.d_anyLocal;
}
if(distributor->isOverloaded()) {
- if(logDNSQueries)
- g_log<<"Dropped query, backends are overloaded"<<endl;
+ if(logDNSQueries)
+ g_log<<": Dropped query, backends are overloaded"<<endl;
overloadDrops++;
continue;
}
-
- if(PC.enabled() && logDNSQueries)
- g_log<<"packetcache MISS"<<endl;
+
+ if (logDNSQueries) {
+ if (PC.enabled()) {
+ g_log<<": packetcache MISS"<<endl;
+ } else {
+ g_log<<endl;
+ }
+ }
try {
distributor->question(question, &sendout); // otherwise, give to the distributor
g_doLuaRecord = ::arg().mustDo("enable-lua-records");
g_LuaRecordSharedState = (::arg()["enable-lua-records"] == "shared");
g_luaRecordExecLimit = ::arg().asNum("lua-records-exec-limit");
+ g_luaHealthChecksInterval = ::arg().asNum("lua-health-checks-interval");
+ g_luaHealthChecksExpireDelay = ::arg().asNum("lua-health-checks-expire-delay");
#endif
DNSPacket::s_udpTruncationThreshold = std::max(512, ::arg().asNum("udp-truncation-threshold"));
PC.setMaxEntries(::arg().asNum("max-packet-cache-entries"));
QC.setMaxEntries(::arg().asNum("max-cache-entries"));
+ if (!PC.enabled() && ::arg().mustDo("log-dns-queries")) {
+ g_log<<Logger::Warning<<"Packet cache disabled, logging queries without HIT/MISS"<<endl;
+ }
+
stubParseResolveConf();
if(!::arg()["chroot"].empty()) {