From 444b51356c20471c891dd41c7b08b6fb4d475cb3 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 22 Dec 2022 22:04:03 +0100 Subject: fix local dns search Previously, the /etc/resolv.conf was inherited from the host. It would thus also inherit the search domains. Now, the generated image lacks the host's resolv.conf and thus it search domains. This is good for reproducibility. In order to continue resolving plain host names, we tell qemu to serve the search domain via dhcp and we tell networkd to trust the dhcp server's domains. Signed-off-by: Jochen Sprickerhof --- debvm-run | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'debvm-run') diff --git a/debvm-run b/debvm-run index 9b26a76..ffae61c 100755 --- a/debvm-run +++ b/debvm-run @@ -144,6 +144,10 @@ fi if test -n "$SSHPORT"; then NETDEV="$NETDEV,hostfwd=tcp:127.0.0.1:$SSHPORT-:22" fi +DNSSEARCH=$(dnsdomainname) +if test -n "$DNSSEARCH"; then + NETDEV="$NETDEV,dnssearch=$DNSSEARCH" +fi set -- \ -append "$KERNEL_CMDLINE" \ -netdev "$NETDEV" \ -- cgit v1.2.3 From fa29c199e7dfda1cc9c93f6948e8d9688c345d64 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Fri, 23 Dec 2022 07:47:16 +0100 Subject: debvm-run: change dhcp option for dns search systemd on Debian stretch does not yet understand dnssearch aka dhcp option 119 and ignores it. Instead we pass it as domain name aka dhcp option 15. This option can only specify one name, which is what we do already. Beyond extending the search list, it may also affect the fqdn of the VM, but this shouldn't hurt. --- debvm-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debvm-run') diff --git a/debvm-run b/debvm-run index ffae61c..06dd250 100755 --- a/debvm-run +++ b/debvm-run @@ -146,7 +146,7 @@ if test -n "$SSHPORT"; then fi DNSSEARCH=$(dnsdomainname) if test -n "$DNSSEARCH"; then - NETDEV="$NETDEV,dnssearch=$DNSSEARCH" + NETDEV="$NETDEV,domainname=$DNSSEARCH" fi set -- \ -append "$KERNEL_CMDLINE" \ -- cgit v1.2.3