]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: don't send .local requests to DNS servers
authorDaniel Mack <daniel@zonque.org>
Tue, 8 Dec 2015 17:29:52 +0000 (18:29 +0100)
committerDaniel Mack <daniel@zonque.org>
Wed, 9 Dec 2015 17:49:14 +0000 (18:49 +0100)
DNS names ending with .local are specific to mDNS, so don't use them
on DNS scopes.

src/resolve/resolved-dns-scope.c

index eae903526b88f6489d7a353874f2894d94b6f2a2..91e23531f52daaf5e6895f62196e9fd50b8d09c8 100644 (file)
@@ -433,7 +433,11 @@ DnsScopeMatch dns_scope_good_domain(DnsScope *s, int ifindex, uint64_t flags, co
                     dns_name_endswith(domain, "8.e.f.ip6.arpa") == 0 &&
                     dns_name_endswith(domain, "9.e.f.ip6.arpa") == 0 &&
                     dns_name_endswith(domain, "a.e.f.ip6.arpa") == 0 &&
-                    dns_name_endswith(domain, "b.e.f.ip6.arpa") == 0)
+                    dns_name_endswith(domain, "b.e.f.ip6.arpa") == 0 &&
+                    /* If networks use .local in their private setups, they are supposed to also add .local to their search
+                     * domains, which we already checked above. Otherwise, we consider .local specific to mDNS and won't
+                     * send such queries ordinary DNS servers. */
+                    dns_name_endswith(domain, "local") == 0)
                         return DNS_SCOPE_MAYBE;
 
                 return DNS_SCOPE_NO;