From 861b70fc2fefc7717cd7de1dafb118176aca846b Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Fri, 9 Jul 2021 22:48:26 +0200 Subject: setup-dns: Use FQDN from hostname as domain --- setup-alpine.in | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'setup-alpine.in') diff --git a/setup-alpine.in b/setup-alpine.in index 4ffae48..3c4d2da 100644 --- a/setup-alpine.in +++ b/setup-alpine.in @@ -6,16 +6,6 @@ VERSION=@VERSION@ PREFIX= . $PREFIX/lib/libalpine.sh -# Extract fully qualified domain name from current hostname. If none is -# currently set, use 'my.domain'. -get_fqdn() { - local _dn - _dn=$(hostname -f 2>/dev/null) - _dn=${_dn#$(hostname -s 2>/dev/null)} - _dn=${_dn#.} - echo "${_dn:=my.domain}" -} - is_qemu() { grep -q "QEMU" /proc/cpuinfo \ || strings /sys/firmware/dmi/tables/DMI 2>/dev/null | grep -q QEMU @@ -175,7 +165,7 @@ _dn=$(sed -n \ _hn=$(hostname) _hn=${_hn%%.*} -sed -i -e "s/^127\.0\.0\.1.*/127.0.0.1\t${_hn}.${_dn:-$(get_fqdn)} ${_hn} localhost.localdomain localhost/" /etc/hosts +sed -i -e "s/^127\.0\.0\.1.*/127.0.0.1\t${_hn}.${_dn:-$(get_fqdn my.domain)} ${_hn} localhost.localdomain localhost/" /etc/hosts if [ -z "$quick" ]; then $PREFIX/sbin/setup-proxy -q ${PROXYOPTS} -- cgit v1.2.3