<p>The internal DNS component fof Squid now supports multicast DNS (mDNS) resolution in
accordance with RFC 6762.
-<p>There is no additional or special configuration required. The multicast DNS group IP
- addresses for IPv4 and IPv6 resolving are added to the set of available DNS resolvers
- and used automatically for domain names ending in <em>.local</em> before attempting a
- secondary resolution on the configured resolvers. Domains without <em>.local</em> are
- resolved using only the configured DNS resolvers.
+<p>The <em>dns_multicast_local</em> directive must be set to <em>on</em> to enable this
+ feature.
+
+<p>The multicast DNS group IP addresses for IPv4 and IPv6 resolving are added to the set
+ of available DNS resolvers and used automatically for domain names ending in <em>.local</em>
+ and reverse-DNS lookups before attempting a secondary resolution on the configured
+ resolvers. Domains without <em>.local</em> are resolved using only the configured resolvers.
<p>Statistics for multicast DNS resolution can be found on the <em>idns</em> cache manager
report.
<p>Whether Squid supports directive parameters with spaces, quotes, and other
special characters. Surround such parameters with "double quotes".
+ <tag>dns_multicast_local</tag>
+ <p>Use multicast DNS for <em>.local</em> domains and reverse-DNS resolution.
+
<tag>note</tag>
<p>Use ACLs to annotate a transaction with customized annotations
which can be logged in access.log
Squid to handle single-component names, enable this option.
DOC_END
+NAME: dns_multicast_local
+COMMENT: on|off
+TYPE: onoff
+DEFAULT: off
+DEFAULT_DOC: Search for .local and .arpa names is disabled.
+LOC: Config.onoff.dns_mdns
+DOC_START
+ When set to on, Squid sends multicast DNS lookups on the local
+ network for domains ending in .local and .arpa.
+ This enables local servers and devices to be contacted in an
+ ad-hoc or zero-configuration network environment.
+DOC_END
+
NAME: dns_nameservers
TYPE: wordlist
DEFAULT: none
static void
idnsCheckMDNS(idns_query *q)
{
+ if (!Config.onoff.dns_mdns || q->permit_mdns)
+ return;
+
size_t slen = strlen(q->name);
if (slen > 6 && memcmp(q->name +(slen-6),".local", 6) == 0) {
q->permit_mdns = true;
{
nns_mdns_count=0;
+ // mDNS is disabled
+ if (!Config.onoff.dns_mdns)
+ return;
+
// mDNS resolver addresses are explicit multicast group IPs
if (Ip::EnableIpv6) {
idnsAddNameserver("FF02::FB");
storeAppendPrintf(sentry, "Internal DNS Statistics:\n");
storeAppendPrintf(sentry, "\nThe Queue:\n");
storeAppendPrintf(sentry, " DELAY SINCE\n");
- storeAppendPrintf(sentry, " ID SIZE SENDS FIRST SEND LAST SEND\n");
- storeAppendPrintf(sentry, "------ ---- ----- ---------- ---------\n");
+ storeAppendPrintf(sentry, " ID SIZE SENDS FIRST SEND LAST SEND M FQDN\n");
+ storeAppendPrintf(sentry, "------ ---- ----- ---------- --------- - ----\n");
for (n = lru_list.head; n; n = n->next) {
q = (idns_query *)n->data;
- storeAppendPrintf(sentry, "%#06x %4d %5d %10.3f %9.3f\n",
+ storeAppendPrintf(sentry, "%#06x %4d %5d %10.3f %9.3f %c %s\n",
(int) q->query_id, (int) q->sz, q->nsends,
tvSubDsec(q->start_t, current_time),
- tvSubDsec(q->sent_t, current_time));
+ tvSubDsec(q->sent_t, current_time),
+ (q->permit_mdns? 'M':' '),
+ q->name);
}
if (Config.dns.packet_max > 0)
- storeAppendPrintf(sentry, "DNS jumbo-grams: %zd Bytes\n", Config.dns.packet_max);
+ storeAppendPrintf(sentry, "\nDNS jumbo-grams: %zd Bytes\n", Config.dns.packet_max);
else
- storeAppendPrintf(sentry, "DNS jumbo-grams: not working\n");
+ storeAppendPrintf(sentry, "\nDNS jumbo-grams: not working\n");
storeAppendPrintf(sentry, "\nNameservers:\n");
storeAppendPrintf(sentry, "IP ADDRESS # QUERIES # REPLIES Type\n");
debugs(78, 3, "idnsPTRLookup: buf is " << q->sz << " bytes for " << ip <<
", id = 0x" << std::hex << q->query_id);
- q->permit_mdns = true;
+ q->permit_mdns = Config.onoff.dns_mdns;
idnsStartQuery(q, callback, data);
}