}
#endif
});
+
+ g_lua.writeFunction("setAllowEmptyResponse", [](bool allow) { g_allowEmptyResponse=allow; });
}
vector<std::function<void(void)>> setupLua(bool client, const std::string& config)
typedef boost::variant<bool, double, std::string> configentry_t;
std::vector<std::pair<std::string, configentry_t> > configEntries {
{ "acl", g_ACL.getLocal()->toString() },
+ { "allow-empty-response", g_allowEmptyResponse },
{ "control-socket", g_serverControl.toStringWithPort() },
{ "ecs-override", g_ECSOverride },
{ "ecs-source-prefix-v4", (double) g_ECSSourcePrefixV4 },
bool g_verboseHealthChecks{false};
uint32_t g_staleCacheEntriesTTL{0};
bool g_syslog{true};
+bool g_allowEmptyResponse{false};
GlobalStateHolder<NetmaskGroup> g_ACL;
string g_outputBuffer;
}
if (dh->qdcount == 0) {
- if (dh->rcode != RCode::NXDomain) {
+ if (dh->rcode != RCode::NXDomain && g_allowEmptyResponse) {
return true;
}
else {
extern std::atomic<uint16_t> g_downstreamTCPCleanupInterval;
extern size_t g_udpVectorSize;
extern bool g_preserveTrailingData;
+extern bool g_allowEmptyResponse;
#ifdef HAVE_EBPF
extern shared_ptr<BPFFilter> g_defaultBPFFilter;