mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-08 20:58:20 +03:00
parent
452ca09152
commit
8631708741
@ -248,6 +248,13 @@
|
||||
in use.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>ReadEtcHosts=</varname></term>
|
||||
<listitem><para>Takes a boolean argument. If <literal>yes</literal> (the default), the DNS stub resolver will read
|
||||
<filename>/etc/hosts</filename>, and try to resolve hosts or address by using the entries in the file before
|
||||
sending query to DNS servers.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
@ -324,6 +324,9 @@ int manager_etc_hosts_lookup(Manager *m, DnsQuestion* q, DnsAnswer **answer) {
|
||||
assert(q);
|
||||
assert(answer);
|
||||
|
||||
if (!m->read_etc_hosts)
|
||||
return 0;
|
||||
|
||||
r = manager_etc_hosts_read(m);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
@ -26,3 +26,4 @@ Resolve.DNSSEC, config_parse_dnssec_mode, 0,
|
||||
Resolve.DNSOverTLS, config_parse_dns_over_tls_mode, 0, offsetof(Manager, dns_over_tls_mode)
|
||||
Resolve.Cache, config_parse_bool, 0, offsetof(Manager, enable_cache)
|
||||
Resolve.DNSStubListener, config_parse_dns_stub_listener_mode, 0, offsetof(Manager, dns_stub_listener_mode)
|
||||
Resolve.ReadEtcHosts, config_parse_bool, 0, offsetof(Manager, read_etc_hosts)
|
||||
|
@ -581,6 +581,7 @@ int manager_new(Manager **ret) {
|
||||
m->read_resolv_conf = true;
|
||||
m->need_builtin_fallbacks = true;
|
||||
m->etc_hosts_last = m->etc_hosts_mtime = USEC_INFINITY;
|
||||
m->read_etc_hosts = true;
|
||||
|
||||
r = dns_trust_anchor_load(&m->trust_anchor);
|
||||
if (r < 0)
|
||||
|
@ -117,6 +117,7 @@ struct Manager {
|
||||
Set* etc_hosts_by_address;
|
||||
Hashmap* etc_hosts_by_name;
|
||||
usec_t etc_hosts_last, etc_hosts_mtime;
|
||||
bool read_etc_hosts;
|
||||
|
||||
/* Local DNS stub on 127.0.0.53:53 */
|
||||
int dns_stub_udp_fd;
|
||||
|
@ -21,3 +21,4 @@
|
||||
#DNSOverTLS=@DEFAULT_DNS_OVER_TLS_MODE@
|
||||
#Cache=yes
|
||||
#DNSStubListener=udp
|
||||
#ReadEtcHosts=yes
|
||||
|
Loading…
x
Reference in New Issue
Block a user