summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/commands/os_dns.cpp1
-rw-r--r--modules/m_dns.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp
index 687f44f4a..b3062fa3d 100644
--- a/modules/commands/os_dns.cpp
+++ b/modules/commands/os_dns.cpp
@@ -940,7 +940,6 @@ class ModuleDNS : public Module
if (packet->answers.size() == answer_size)
{
Log(this) << "Error! There are no servers with any IPs of type " << q.type;
- /* Send back an empty answer anyway */
}
}
}
diff --git a/modules/m_dns.cpp b/modules/m_dns.cpp
index 93f09246e..4dc6d7bfa 100644
--- a/modules/m_dns.cpp
+++ b/modules/m_dns.cpp
@@ -854,6 +854,9 @@ class MyManager : public Manager, public Timer
}
}
+ if (packet->answers.empty() && packet->authorities.empty() && packet->additional.empty() && packet->error == ERROR_NONE)
+ packet->error = ERROR_REFUSED; // usually safe, won't cause an NXDOMAIN to get cached
+
s->Reply(packet);
return true;
}