summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/operserv.example.conf2
-rw-r--r--include/modules/dns.h4
-rw-r--r--modules/commands/os_dns.cpp10
3 files changed, 9 insertions, 7 deletions
diff --git a/data/operserv.example.conf b/data/operserv.example.conf
index 6af800e31..d53337258 100644
--- a/data/operserv.example.conf
+++ b/data/operserv.example.conf
@@ -293,7 +293,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
*
* Finally set a NS record for irc.example.com. to BIND or services.
*/
-module
+#module
{
name = "os_dns"
diff --git a/include/modules/dns.h b/include/modules/dns.h
index 99b84098f..44b9370cb 100644
--- a/include/modules/dns.h
+++ b/include/modules/dns.h
@@ -34,7 +34,9 @@ namespace DNS
/* IPv6 AAAA lookup */
QUERY_AAAA = 28,
/* Zone transfer */
- QUERY_AXFR = 252
+ QUERY_AXFR = 252,
+ /* A lookup for any record */
+ QUERY_ANY = 255
};
/** Flags that can be AND'd into DNSPacket::flags to receive certain values
diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp
index c71b1f887..1df401112 100644
--- a/modules/commands/os_dns.cpp
+++ b/modules/commands/os_dns.cpp
@@ -774,7 +774,7 @@ class ModuleDNS : public Module
return;
/* Currently we reply to any QR for A/AAAA */
const DNS::Question& q = req.questions[0];
- if (q.type != DNS::QUERY_A && q.type != DNS::QUERY_AAAA && q.type != DNS::QUERY_AXFR)
+ if (q.type != DNS::QUERY_A && q.type != DNS::QUERY_AAAA && q.type != DNS::QUERY_AXFR && q.type != DNS::QUERY_ANY)
return;
DNSZone *zone = DNSZone::Find(q.name);
@@ -791,7 +791,7 @@ class ModuleDNS : public Module
{
DNS::QueryType q_type = s->GetIPs()[j].find(':') != Anope::string::npos ? DNS::QUERY_AAAA : DNS::QUERY_A;
- if (q.type == DNS::QUERY_AXFR || q_type == q.type)
+ if (q.type == DNS::QUERY_AXFR || q.type == DNS::QUERY_ANY || q_type == q.type)
{
DNS::ResourceRecord rr(q.name, q_type);
rr.ttl = this->ttl;
@@ -815,7 +815,7 @@ class ModuleDNS : public Module
{
DNS::QueryType q_type = s->GetIPs()[j].find(':') != Anope::string::npos ? DNS::QUERY_AAAA : DNS::QUERY_A;
- if (q.type == DNS::QUERY_AXFR || q_type == q.type)
+ if (q.type == DNS::QUERY_AXFR || q.type == DNS::QUERY_ANY || q_type == q.type)
{
DNS::ResourceRecord rr(q.name, q_type);
rr.ttl = this->ttl;
@@ -844,7 +844,7 @@ class ModuleDNS : public Module
{
DNS::QueryType q_type = s->GetIPs()[j].find(':') != Anope::string::npos ? DNS::QUERY_AAAA : DNS::QUERY_A;
- if (q.type == DNS::QUERY_AXFR || q_type == q.type)
+ if (q.type == DNS::QUERY_AXFR || q.type == DNS::QUERY_ANY || q_type == q.type)
{
DNS::ResourceRecord rr(q.name, q_type);
rr.ttl = this->ttl;
@@ -856,7 +856,7 @@ class ModuleDNS : public Module
if (packet->answers.size() == answer_size)
{
- Log(this) << "Error! There are no servers with any IPs. At all.";
+ Log(this) << "Error! There are no servers with any IPs of type " << q.type;
/* Send back an empty answer anyway */
}
}