diff --git a/src/resolve/resolved-etc-hosts.c b/src/resolve/resolved-etc-hosts.c index 00c76a9977..b38c011e7c 100644 --- a/src/resolve/resolved-etc-hosts.c +++ b/src/resolve/resolved-etc-hosts.c @@ -72,7 +72,8 @@ void etc_hosts_clear(EtcHosts *hosts) { void manager_etc_hosts_flush(Manager *m) { etc_hosts_clear(&m->etc_hosts); m->etc_hosts_stat = (struct stat) {}; - m->etc_hosts_last = USEC_INFINITY; + /* NB: We do not reset m->etc_hosts_last here, because manager_etc_hosts_read() calls us and needs it + * to stay in effect for the reload suppression to work */ } static int parse_line(EtcHosts *hosts, unsigned nr, const char *line) { diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 25a51ed02b..e96ae4393c 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -664,6 +664,9 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa manager_etc_hosts_flush(m); manager_static_records_flush(m); + m->etc_hosts_last = USEC_INFINITY; + m->static_records_last = USEC_INFINITY; + manager_set_defaults(m); r = dns_trust_anchor_load(&m->trust_anchor); diff --git a/src/resolve/resolved-static-records.c b/src/resolve/resolved-static-records.c index 4aa6f2e421..d905d507d6 100644 --- a/src/resolve/resolved-static-records.c +++ b/src/resolve/resolved-static-records.c @@ -29,7 +29,7 @@ * serializations of DNS RRs. Also note the semantics are different from DNS zone file format, for example * regarding delegation (i.e. the RRs defined here have no effect on subdomains), which is probably nicer for * one-off mappings of domains to specific resources. Or in other words, this is supposed to be a drop-in - * based alternative to /etc/hosts, not a one to DNS zone files. (The JSON format is also a lot more + * based alternative to /etc/hosts, not one to DNS zone files. (The JSON format is also a lot more * extensible to us, for example we could teach it to map certain lookups to specific DNS errors, or extend * it so that subdomains always get NXDOMAIN or similar). * @@ -222,5 +222,4 @@ void manager_static_records_flush(Manager *m) { m->static_records = hashmap_free(m->static_records); m->static_records_stat = set_free(m->static_records_stat); - m->static_records_last = USEC_INFINITY; }