From 9f4f29bd29a36099f4e4d74e5305ca3de896f9b3 Mon Sep 17 00:00:00 2001 From: Vincent Dahmen Date: Tue, 30 Dec 2025 06:01:01 +0100 Subject: [PATCH] lib/network: adds symlink to configure systemd-resovled properly (#4052) * lib/network: adds symlink to configure systemd-resovled properly * lib/network: adds overwrite mechanism to enforce resolved symlink --------- Co-authored-by: Vincent Dahmen --- archinstall/lib/installer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index ee6832a1..2afe9064 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -755,6 +755,13 @@ class Installer: for psk in psk_files: shutil.copy2(psk, f'{self.target}/var/lib/iwd/{os.path.basename(psk)}') + # Enable systemd-resolved by (forcefully) setting a symlink + # For further details see https://wiki.archlinux.org/title/Systemd-resolved#DNS + resolv_config_path = Path(f'{self.target}/etc/resolv.conf') + if resolv_config_path.exists(): + os.unlink(resolv_config_path) + os.symlink('/run/systemd/resolve/stub-resolv.conf', resolv_config_path) + # Copy (if any) systemd-networkd config files if netconfigurations := glob.glob('/etc/systemd/network/*'): if not os.path.isdir(f'{self.target}/etc/systemd/network/'):