mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
networkd: permit DNS "DefaultRoute" configuration in .network files
This commit is contained in:
parent
09451975df
commit
7ece6f5897
@ -547,6 +547,17 @@
|
|||||||
name servers limited to a specific link.</para>
|
name servers limited to a specific link.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>DNSDefaultRoute=</varname></term>
|
||||||
|
<listitem>
|
||||||
|
<para>Takes a boolean argument. If true, this link's configured DNS servers are used for resolving domain
|
||||||
|
names that do not match any link's configured <varname>Domains=</varname> setting. If false, this link's
|
||||||
|
configured DNS servers are never used for such domains, and are exclusively used for resolving names that
|
||||||
|
match at least one of the domains configured on this link. If not specified defaults to an automatic mode:
|
||||||
|
queries not matching any link's configured domains will be routed to this link if it has no routing-only
|
||||||
|
domains configured.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>NTP=</varname></term>
|
<term><varname>NTP=</varname></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@ -3929,6 +3929,8 @@ int link_save(Link *link) {
|
|||||||
resolve_support_to_string(link->network->llmnr));
|
resolve_support_to_string(link->network->llmnr));
|
||||||
fprintf(f, "MDNS=%s\n",
|
fprintf(f, "MDNS=%s\n",
|
||||||
resolve_support_to_string(link->network->mdns));
|
resolve_support_to_string(link->network->mdns));
|
||||||
|
if (link->network->dns_default_route >= 0)
|
||||||
|
fprintf(f, "DNS_DEFAULT_ROUTE=%s\n", yes_no(link->network->dns_default_route));
|
||||||
|
|
||||||
if (link->network->dns_over_tls_mode != _DNS_OVER_TLS_MODE_INVALID)
|
if (link->network->dns_over_tls_mode != _DNS_OVER_TLS_MODE_INVALID)
|
||||||
fprintf(f, "DNS_OVER_TLS=%s\n",
|
fprintf(f, "DNS_OVER_TLS=%s\n",
|
||||||
|
@ -58,6 +58,7 @@ Network.Address, config_parse_address,
|
|||||||
Network.Gateway, config_parse_gateway, 0, 0
|
Network.Gateway, config_parse_gateway, 0, 0
|
||||||
Network.Domains, config_parse_domains, 0, 0
|
Network.Domains, config_parse_domains, 0, 0
|
||||||
Network.DNS, config_parse_dns, 0, 0
|
Network.DNS, config_parse_dns, 0, 0
|
||||||
|
Network.DNSDefaultRoute, config_parse_tristate, 0, offsetof(Network, dns_default_route)
|
||||||
Network.LLMNR, config_parse_resolve_support, 0, offsetof(Network, llmnr)
|
Network.LLMNR, config_parse_resolve_support, 0, offsetof(Network, llmnr)
|
||||||
Network.MulticastDNS, config_parse_resolve_support, 0, offsetof(Network, mdns)
|
Network.MulticastDNS, config_parse_resolve_support, 0, offsetof(Network, mdns)
|
||||||
Network.DNSOverTLS, config_parse_dns_over_tls_mode, 0, offsetof(Network, dns_over_tls_mode)
|
Network.DNSOverTLS, config_parse_dns_over_tls_mode, 0, offsetof(Network, dns_over_tls_mode)
|
||||||
|
@ -168,6 +168,7 @@ int network_load_one(Manager *manager, const char *filename) {
|
|||||||
|
|
||||||
.lldp_mode = LLDP_MODE_ROUTERS_ONLY,
|
.lldp_mode = LLDP_MODE_ROUTERS_ONLY,
|
||||||
|
|
||||||
|
.dns_default_route = -1,
|
||||||
.llmnr = RESOLVE_SUPPORT_YES,
|
.llmnr = RESOLVE_SUPPORT_YES,
|
||||||
.mdns = RESOLVE_SUPPORT_NO,
|
.mdns = RESOLVE_SUPPORT_NO,
|
||||||
.dnssec_mode = _DNSSEC_MODE_INVALID,
|
.dnssec_mode = _DNSSEC_MODE_INVALID,
|
||||||
@ -657,7 +658,6 @@ int config_parse_domains(
|
|||||||
* routing domain, unconditionally. */
|
* routing domain, unconditionally. */
|
||||||
is_route = true;
|
is_route = true;
|
||||||
domain = "."; /* make sure we don't allow empty strings, thus write the root domain as "." */
|
domain = "."; /* make sure we don't allow empty strings, thus write the root domain as "." */
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
r = dns_name_normalize(domain, 0, &normalized);
|
r = dns_name_normalize(domain, 0, &normalized);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
|
@ -260,17 +260,20 @@ struct Network {
|
|||||||
Hashmap *prefixes_by_section;
|
Hashmap *prefixes_by_section;
|
||||||
Hashmap *rules_by_section;
|
Hashmap *rules_by_section;
|
||||||
|
|
||||||
|
/* All kinds of DNS configuration */
|
||||||
struct in_addr_data *dns;
|
struct in_addr_data *dns;
|
||||||
unsigned n_dns;
|
unsigned n_dns;
|
||||||
|
char **search_domains, **route_domains;
|
||||||
char **search_domains, **route_domains, **ntp, **bind_carrier;
|
int dns_default_route;
|
||||||
|
|
||||||
ResolveSupport llmnr;
|
ResolveSupport llmnr;
|
||||||
ResolveSupport mdns;
|
ResolveSupport mdns;
|
||||||
DnssecMode dnssec_mode;
|
DnssecMode dnssec_mode;
|
||||||
DnsOverTlsMode dns_over_tls_mode;
|
DnsOverTlsMode dns_over_tls_mode;
|
||||||
Set *dnssec_negative_trust_anchors;
|
Set *dnssec_negative_trust_anchors;
|
||||||
|
|
||||||
|
char **ntp;
|
||||||
|
char **bind_carrier;
|
||||||
|
|
||||||
LIST_FIELDS(Network, networks);
|
LIST_FIELDS(Network, networks);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -159,6 +159,7 @@ InvertRule=
|
|||||||
RouterPreference=
|
RouterPreference=
|
||||||
DNSLifetimeSec=
|
DNSLifetimeSec=
|
||||||
DNS=
|
DNS=
|
||||||
|
DNSDefaultRoute=
|
||||||
RouterLifetimeSec=
|
RouterLifetimeSec=
|
||||||
Domains=
|
Domains=
|
||||||
EmitDNS=
|
EmitDNS=
|
||||||
|
Loading…
Reference in New Issue
Block a user