From 91a62d09e50b88ea45c308c78c2fdb534fb11e0c Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 20 Jul 2025 00:55:31 +0800 Subject: [PATCH] systemd: network: Add a note about temporary static resolv.conf for the chroot environment I still think this is obvious but it seems some people are surprised by "unknown host" in chroot. Let's just note it before they propose a change for every BLFS package of which the build process requires an Internet connection. --- chapter09/networkd.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/chapter09/networkd.xml b/chapter09/networkd.xml index eb348ec1e..7c947a9eb 100644 --- a/chapter09/networkd.xml +++ b/chapter09/networkd.xml @@ -213,6 +213,21 @@ EOF /run/systemd/resolve/stub-resolv.conf. So it's unnecessary to create a /etc/resolv.conf manually. + + + + If you want to use systemd-resolved for the + LFS system but you need to access the Internet in the chroot + environment (for example, for building a BLFS package of which the + build process requires an Internet connection), create the + /etc/resolv.conf file following the + static configuration below for the chroot environment so the name + resolution will work in the chroot environment. When you exit + the chroot environment, remove it so + systemd-resolved will create the symlink on + boot. + +