]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: demote the fallback dns servers 34051/head
authorRonan Pigott <ronan@rjp.ie>
Wed, 21 Aug 2024 14:49:59 +0000 (07:49 -0700)
committerRonan Pigott <ronan@rjp.ie>
Wed, 21 Aug 2024 17:27:07 +0000 (10:27 -0700)
This softens the behavior originally introduced in eded61e410df to apply
only to the fallback dns servers.

The intent is that the global FallbackDNS (instead of DNS) can now be
used in conjunction with the per-link dns, providing a fallback behavior
without introducing a scope overlap.

References: eded61e410df (resolved: demote the global unicast scope, 2024-08-19)

man/systemd-resolved.service.xml
src/resolve/resolved-dns-scope.c

index 13c0da987fe6fc0dbbd3116a4682ec548dba42b4..f7be0793cf56556e6b87d36642d46575978c8b11 100644 (file)
       is sent to all DNS servers that are configured on links with the <varname>DefaultRoute=</varname>
       option set, as well as the globally configured DNS server.</para></listitem>
 
-      <listitem><para>If there is no link configured as <varname>DefaultRoute=</varname> and no global DNS
-      server configured, one of the compiled-in fallback DNS servers is used.</para></listitem>
+      <listitem><para>If there are no DNS servers configured on any link also configured as
+      <varname>DefaultRoute=</varname> and no global DNS server configured, one of the compiled-in fallback
+      DNS servers is used.</para></listitem>
 
       <listitem><para>Otherwise the unicast DNS query fails, as no suitable DNS servers can be determined.
       </para></listitem>
index 21b9844e0472f1a4d8a352b6f04d94426ec46f39..4d4e952dac43f2e61e8834bc25d95f08d404ba3a 100644 (file)
@@ -778,6 +778,10 @@ DnsScopeMatch dns_scope_good_domain(
                 if (!dns_scope_is_default_route(s))
                         return DNS_SCOPE_NO;
 
+                /* Prefer suitable per-link scopes where possible */
+                if (dns_server_is_fallback(dns_scope_get_dns_server(s)))
+                        return DNS_SCOPE_LAST_RESORT;
+
                 return DNS_SCOPE_MAYBE;
         }