summaryrefslogtreecommitdiffstats
path: root/src/resolve
diff options
context:
space:
mode:
authorJacek Migacz <jmigacz@redhat.com>2022-08-22 18:24:29 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-08-26 04:19:17 +0200
commitd896260958c78ecf1310ea2483c68efefb7842d6 (patch)
treee0f06215ff7715f7a1cb0a9880ee7a0a3fee5af8 /src/resolve
parentsleep: freeze and thaw user.slice to save resource while suspend (diff)
downloadsystemd-d896260958c78ecf1310ea2483c68efefb7842d6.tar.xz
systemd-d896260958c78ecf1310ea2483c68efefb7842d6.zip
resolve: control system hostname synthesis via environment variable
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-dns-synthesize.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-synthesize.c b/src/resolve/resolved-dns-synthesize.c
index 9712322a0a..b3442ad906 100644
--- a/src/resolve/resolved-dns-synthesize.c
+++ b/src/resolve/resolved-dns-synthesize.c
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
+#include "env-util.h"
#include "hostname-util.h"
#include "local-addresses.h"
#include "missing_network.h"
@@ -410,6 +411,8 @@ int dns_synthesize_answer(
} else if (manager_is_own_hostname(m, name)) {
+ if (getenv_bool("SYSTEMD_RESOLVED_SYNTHESIZE_HOSTNAME") == 0)
+ continue;
r = synthesize_system_hostname_rr(m, key, ifindex, &answer);
if (r < 0)
return log_error_errno(r, "Failed to synthesize system hostname RRs: %m");
@@ -444,6 +447,9 @@ int dns_synthesize_answer(
} else if (dns_name_address(name, &af, &address) > 0) {
int v, w;
+ if (getenv_bool("SYSTEMD_RESOLVED_SYNTHESIZE_HOSTNAME") == 0)
+ continue;
+
v = synthesize_system_hostname_ptr(m, af, &address, ifindex, &answer);
if (v < 0)
return log_error_errno(v, "Failed to synthesize system hostname PTR RR: %m");