]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: always read /etc/resolv.conf on reload systemd-resolved
authorPasquale van Heumen <pasquale@avtware.com>
Tue, 9 Dec 2025 15:45:10 +0000 (16:45 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 9 Dec 2025 19:56:23 +0000 (04:56 +0900)
When systemd-resolved is used in resolv.conf foreign mode, reloading the
systemd-resolved daemon does not read resolv.conf when not touched since
the last time resolved read the file. Since the DNS servers list is
flushed during a reload, resolved forgets about the servers
in /etc/resolv.conf

When reloading the daemon it is expected that all configuration is
reloaded regardless of the disk timestamps.

src/resolve/resolved-manager.c

index 221e4cf72a3b4f4530ce0dca7b20626207a7dd2a..aa4d43042ccaec3bc2dcf7123a9647042678d145 100644 (file)
@@ -641,6 +641,7 @@ static void manager_set_defaults(Manager *m) {
         m->cache_from_localhost = false;
         m->stale_retention_usec = 0;
         m->refuse_record_types = set_free(m->refuse_record_types);
+        m->resolv_conf_stat = (struct stat) {};
 }
 
 static int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {