the installed ones. By default non-UTF-8 locales are suppressed from the
selection, since we are living in the 21st century.
+`systemd-resolved`:
+
+* `$SYSTEMD_RESOLVED_SYNTHESIZE_HOSTNAME` — if set to "0", `systemd-resolved`
+ won't synthesize system hostname on both regular and reverse lookups.
+
`systemd-sysext`:
* `$SYSTEMD_SYSEXT_HIERARCHIES` — this variable may be used to override which
/* 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"
} 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");
} 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");