Bug#947688: systemd-networkd: Python socket.getfqdn() not working properly when resolv.conf lacks "domain" key

Dirk Heinrichs dirk.heinrichs at altum.de
Sun Dec 29 10:41:34 GMT 2019


Package: systemd
Version: 241-7~deb10u2
Severity: normal
Tags: upstream

Hi,

first, a short description of the overall setup: A private (aka home) network
using Samba AD with ISC DHCP for network management and setup. All machines run
up-to-date Debian 10 (buster). I mainly run two types of machines (reg. their
network setup mechanism): Laptops, which use Network-Manager + systemd-
resolved, and others, which use systemd-networkd + systemd-resolved (or better:
should use). I also use Salt for overall systems management.

The problem with the latter setup is that it breaks Python's socket.getfqdn()
function when

        1) systemd-resolved is running
        2) /etc/resolv.conf is a symlink to /run/systemd/resolve/stub-
resolv.conf
        3) /etc/resolv.conf lacks a "domain" entry

On a Laptop, which uses Network-Manager, Python's socket.getfqdn() function
correctly returns the fully qualified domain name with above setup. On all
other systems, which use systemd-networkd, the function only returns the short
hostname. This, for example, breaks the Salt Minion's ability to correctly set
the "fqdn" and "domain" grains (where the latter is calculated from the
former).

The only workaround I found so far for resolving the situation (other than
switching all systems from systemd-networkd to Network-Manager) is to

        1) Stop and disable systemd-resolved
        2) Replace the symlink with a static /etc/resolv.conf file
        3) Add a "domain" entry (in addition to "search") to the file

>From my understanding, there should be no difference in behaviour of Python's
socket.getfqdn() regardless of whether Network-Manager or systemd-networkd is
used for network setup.

Bye...

        Dirk



-- Package-specific info:

-- System Information:
Debian Release: 10.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-6-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8), LANGUAGE= (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages systemd depends on:
ii  adduser          3.118
ii  libacl1          2.2.53-4
ii  libapparmor1     2.13.2-10
ii  libaudit1        1:2.8.4-3
ii  libblkid1        2.34-0.1
ii  libc6            2.28-10
ii  libcap2          1:2.25-2
ii  libcryptsetup12  2:2.1.0-5+deb10u2
ii  libgcrypt20      1.8.4-5
ii  libgnutls30      3.6.7-4
ii  libgpg-error0    1.35-1
ii  libidn11         1.33-2.2
ii  libip4tc0        1.8.2-4
ii  libkmod2         26-1
ii  liblz4-1         1.8.3-1
ii  liblzma5         5.2.4-1
ii  libmount1        2.34-0.1
ii  libpam0g         1.3.1-5
ii  libseccomp2      2.3.3-4
ii  libselinux1      3.0-1
ii  libsystemd0      241-7~deb10u2
ii  mount            2.33.1-0.1
ii  util-linux       2.33.1-0.1

Versions of packages systemd recommends:
ii  dbus            1.12.16-1
ii  libpam-systemd  241-7~deb10u2

Versions of packages systemd suggests:
ii  policykit-1        0.105-25
ii  systemd-container  241-7~deb10u2

Versions of packages systemd is related to:
pn  dracut           <none>
ii  initramfs-tools  0.133+deb10u1
ii  udev             241-7~deb10u2

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list