summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-conf.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-24 18:08:35 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-25 21:58:37 +0100
commit00fa60ae3b2823036cb3e7734f16bce30cb7441d (patch)
tree11c3cfce32ab2efa6e13ea8cfaa3426654cdbac7 /src/resolve/resolved-conf.c
parent0eac462399c8e87bcce252cf058eba9f2678f2bd (diff)
resolved: make sure FallbackDNS= overrides built-in servers, doesn't extend them
Closes #342.
Diffstat (limited to 'src/resolve/resolved-conf.c')
-rw-r--r--src/resolve/resolved-conf.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c
index fe88006fb7..7e3b613816 100644
--- a/src/resolve/resolved-conf.c
+++ b/src/resolve/resolved-conf.c
@@ -116,6 +116,8 @@ int config_parse_dns_servers(
* /etc/resolv.conf */
if (ltype == DNS_SERVER_SYSTEM)
m->read_resolv_conf = false;
+ if (ltype == DNS_SERVER_FALLBACK)
+ m->need_builtin_fallbacks = false;
return 0;
}
@@ -155,11 +157,24 @@ int config_parse_support(
}
int manager_parse_config_file(Manager *m) {
+ int r;
+
assert(m);
- return config_parse_many(PKGSYSCONFDIR "/resolved.conf",
- CONF_PATHS_NULSTR("systemd/resolved.conf.d"),
- "Resolve\0",
- config_item_perf_lookup, resolved_gperf_lookup,
- false, m);
+ r = config_parse_many(PKGSYSCONFDIR "/resolved.conf",
+ CONF_PATHS_NULSTR("systemd/resolved.conf.d"),
+ "Resolve\0",
+ config_item_perf_lookup, resolved_gperf_lookup,
+ false, m);
+ if (r < 0)
+ return r;
+
+ if (m->need_builtin_fallbacks) {
+ r = manager_parse_dns_server_string_and_warn(m, DNS_SERVER_FALLBACK, DNS_SERVERS);
+ if (r < 0)
+ return r;
+ }
+
+ return 0;
+
}