From: Benjamin Drung Date: Wed, 21 Aug 2019 14:15:48 +0000 (+0200) Subject: Fix DNS search entry in /etc/resolv.conf X-Git-Tag: debian/1%20210122~14^2~4 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=99444367edc00f2b58831d4623239973084e6dec Fix DNS search entry in /etc/resolv.conf Commit 66d1235abf2dbc4062ed5bb7aef28d99a5a38eb2 added support for resolving DNS names from initramfs, but only the DNS domain was configured for the DNS search. The DHCP client also provides the `DOMAINSEARCH` variable that should be used for searching if available, because it can contain more than one domain. Signed-off-by: Benjamin Drung --- diff --git a/components/9990-networking.sh b/components/9990-networking.sh index 88bad20..cfafcb0 100755 --- a/components/9990-networking.sh +++ b/components/9990-networking.sh @@ -156,7 +156,6 @@ EOF if [ -n "${DNSDOMAIN}" ] then echo "domain ${DNSDOMAIN}" > /etc/resolv.conf - echo "search ${DNSDOMAIN}" >> /etc/resolv.conf fi for i in ${IPV4DNS0} ${IPV4DNS1} ${IPV4DNS1} ${DNSSERVERS} @@ -166,6 +165,14 @@ EOF echo "nameserver $i" >> /etc/resolv.conf fi done + + if [ -n "${DOMAINSEARCH}" ] + then + echo "search ${DOMAINSEARCH}" >> /etc/resolv.conf + elif [ -n "${DNSDOMAIN}" ] + then + echo "search ${DNSDOMAIN}" >> /etc/resolv.conf + fi fi # Check if we have a network device at all