systemd-resolved
synthesizes DNS resource records (RRs) for the
following cases:
• The local, configured hostname is resolved to all locally
configured IP addresses ordered by their scope, or — if none
are configured — the IPv4 address 127.0.0.2 (which is on the
local loopback interface) and the IPv6 address ::1 (which is
the local host).
• The hostnames "localhost" and "localhost.localdomain" as well
as any hostname ending in ".localhost" or
".localhost.localdomain" are resolved to the IP addresses
127.0.0.1 and ::1.
• The hostname "_gateway" is resolved to all current default
routing gateway addresses, ordered by their metric. This
assigns a stable hostname to the current gateway, useful for
referencing it independently of the current network
configuration state.
• The hostname "_outbound" is resolved to the local IPv4 and
IPv6 addresses that are most likely used for communication
with other hosts. This is determined by requesting a routing
decision to the configured default gateways from the kernel
and then using the local IP addresses selected by this
decision. This hostname is only available if there is at
least one local default gateway configured. This assigns a
stable hostname to the local outbound IP addresses, useful
for referencing them independently of the current network
configuration state.
• The mappings defined in /etc/hosts are resolved to their
configured addresses and back, but they will not affect
lookups for non-address types (like MX). Support for
/etc/hosts may be disabled with ReadEtcHosts=no, see
resolved.conf(5).