#include "test-remotebackend-keys.hh"
bool g_slogStructured{false};
+bool g_logDNSQueries{false};
extern std::unique_ptr<DNSBackend> backendUnderTest;
bool g_anyToTcp;
bool g_8bitDNS;
+bool g_logDNSQueries;
#ifdef HAVE_LUA_RECORDS
bool g_doLuaRecord;
int g_luaRecordExecLimit;
int diff{};
int start{};
- bool logDNSQueries = ::arg().mustDo("log-dns-queries");
shared_ptr<UDPNameserver> NS; // NOLINT(readability-identifier-length)
std::string buffer;
ComboAddress accountremote;
S.ringAccount("queries", question.qdomain, question.qtype);
S.ringAccount("remotes", question.getInnerRemote());
- if (logDNSQueries) {
+ if (g_logDNSQueries) {
if (g_slogStructured) {
if (question.d_ednsRawPacketSizeLimit > 0 && question.getMaxReplyLen() != (unsigned int)question.d_ednsRawPacketSizeLimit) {
slog->info(Logr::Notice, "Query received", "remote", Logging::Loggable(question.getRemoteString()), "query", Logging::Loggable(question.qdomain), "type", Logging::Loggable(question.qtype), "dnssec", Logging::Loggable(question.d_dnssecOk), "max reply length", Logging::Loggable(question.getMaxReplyLen()), "raw packet size limit", Logging::Loggable(question.d_ednsRawPacketSizeLimit));
}
bool haveSomething = PC.get(question, cached, view); // does the PacketCache recognize this question?
if (haveSomething) {
- if (logDNSQueries) {
+ if (g_logDNSQueries) {
SLOG(g_log << ": packetcache HIT" << endl,
slog->info(Logr::Notice, "packetcache HIT"));
}
}
if (distributor->isOverloaded()) {
- if (logDNSQueries) {
+ if (g_logDNSQueries) {
SLOG(g_log << ": Dropped query, backends are overloaded" << endl,
slog->info(Logr::Notice, "Dropped query, backends are overloaded"));
}
continue;
}
- if (logDNSQueries) {
+ if (g_logDNSQueries) {
if (PC.enabled()) {
SLOG(g_log << ": packetcache MISS" << endl,
slog->info(Logr::Notice, "packetcache MISS"));
g_anyToTcp = ::arg().mustDo("any-to-tcp");
g_8bitDNS = ::arg().mustDo("8bit-dns");
+ g_logDNSQueries = ::arg().mustDo("log-dns-queries");
#ifdef HAVE_LUA_RECORDS
g_doLuaRecord = ::arg().mustDo("enable-lua-records");
g_LuaRecordSharedState = (::arg()["enable-lua-records"] == "shared");
void carbonDumpThread(Logr::log_t slog); // Implemented in auth-carbon.cc. Avoids having an auth-carbon.hh declaring exactly one function.
extern bool g_anyToTcp;
extern bool g_8bitDNS;
+extern bool g_logDNSQueries;
extern NetmaskGroup g_proxyProtocolACL;
extern size_t g_proxyProtocolMaximumSize;
#ifdef HAVE_LUA_RECORDS
// NOLINTNEXTLINE(readability-identifier-length)
AuthQueryCache QC;
AuthZoneCache g_zoneCache;
+bool g_logDNSQueries{false};
ArgvMap &arg()
{
po::variables_map g_vm;
bool g_slogStructured{false};
+bool g_logDNSQueries{false};
static Logger::Urgency s_logUrgency;
string g_programname="pdns";
DLOG(SLOG(g_log<<"TCP Connection accepted on fd "<<fd<<endl,
slog->info(Logr::Debug, "TCP Connection accepted", "fd", Logging::Loggable(fd))));
- bool logDNSQueries= ::arg().mustDo("log-dns-queries");
if (g_proxyProtocolACL.match(remote)) {
unsigned int remainingTime = 0;
PacketBuffer proxyData;
std::unique_ptr<DNSPacket> reply;
auto cached = make_unique<DNSPacket>(slog, false);
std::shared_ptr<Logr::Logger> slogger;
- if(logDNSQueries) {
+ if(g_logDNSQueries) {
if (g_slogStructured) {
slogger = slog->withValues("remote", Logging::Loggable(packet->getRemoteString()), "query", Logging::Loggable(packet->qdomain), "type", Logging::Loggable(packet->qtype), "dnssecok", Logging::Loggable(packet->d_dnssecOk), "bufsize", Logging::Loggable(packet->getMaxReplyLen()));
}
view = g_zoneCache.getViewFromNetwork(&netmask);
}
if (PC.get(*packet, *cached, view)) { // short circuit - does the PacketCache recognize this question?
- if(logDNSQueries) {
+ if(g_logDNSQueries) {
SLOG(g_log<<": packetcache HIT"<<endl,
slogger->info(Logr::Notice, "Received TCP query", "packetcache", Logging::Loggable("hit")));
}
continue;
}
}
- if(logDNSQueries) {
+ if(g_logDNSQueries) {
SLOG(g_log<<": packetcache MISS"<<endl,
slogger->info(Logr::Notice, "Received TCP query", "packetcache", Logging::Loggable("miss")));
}
} else {
- if (logDNSQueries) {
+ if (g_logDNSQueries) {
SLOG(g_log<<endl,
slogger->info(Logr::Notice, "Received TCP query"));
}
AuthZoneCache g_zoneCache;
uint16_t g_maxNSEC3Iterations{0};
bool g_slogStructured{false};
+bool g_logDNSQueries{false};
ArgvMap& arg()
{