From 310b8e6c9508c4f35f24c50b3dde8d463e1321ed Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mar 26 2021 16:51:05 +0000 Subject: Move nss-myhostname before nss-mdns4 --- diff --git a/systemd.spec b/systemd.spec index 496ae0e..6a1e111 100644 --- a/systemd.spec +++ b/systemd.spec @@ -811,10 +811,16 @@ function mod_nss() { ' "$1" &>/dev/null || : # Add nss-resolve to hosts - grep -E -q '^hosts:.* resolve' "$1" || - sed -i.bak -r -e ' - s/^(hosts):(.*) files( mdns4_minimal .NOTFOUND=return.)? dns myhostname/\1:\2 files\3 resolve [!UNAVAIL=return] myhostname dns/ + if grep -E -q '^hosts:.* resolve' "$1"; then + sed -i.bak -r -e ' + s/^(hosts):(.*) files( .*) myhostname dns/\1:\2 files myhostname\3 dns/ + ' "$1" &>/dev/null || : + + else + sed -i.bak -r -e ' + s/^(hosts):(.*) files( mdns4_minimal .NOTFOUND=return.)? dns myhostname/\1:\2 files myhostname\3 resolve [!UNAVAIL=return] dns/ ' "$1" &>/dev/null || : + fi fi } @@ -984,6 +990,7 @@ fi * Fri Mar 26 2021 Zbigniew Jędrzejewski-Szmek - 248~rc4-5 - Do not preset systemd-networkd.service and systemd-networkd-wait-online.service on upgrades from before systemd-networkd was split out (#1943263) +- In nsswitch.conf, move nss-myhostname to the front, before nss-mdns4 (#1943199) * Wed Mar 24 2021 Zbigniew Jędrzejewski-Szmek - 248~rc4-4 - Revert patch that seems to cause problems with dns resolution