From afa18e5a3088234590d7a6cf2d7793a532303a3c Mon Sep 17 00:00:00 2001 From: Tanya Degurechaff <34323200+TanyaEleventhGoddess@users.noreply.github.com> Date: Sat, 4 Jul 2020 19:41:17 +0200 Subject: [PATCH] Force hostname inclusion in /etc/hosts Signed-off-by: Tanya Degurechaff <34323200+TanyaEleventhGoddess@users.noreply.github.com> --- templates/lxc-debian.in | 11 +++++++++++ templates/lxc-kali.in | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index 6193c3d..a3603c1 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -120,6 +120,17 @@ EOF # set the hostname cat <<EOF > $rootfs/etc/hostname $hostname +EOF + + # set minimal hosts + cat <<EOF > $rootfs/etc/hosts +127.0.0.1 localhost +127.0.1.1 $hostname + +# The following lines are desirable for IPv6 capable hosts +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters EOF # reconfigure some services diff --git a/templates/lxc-kali.in b/templates/lxc-kali.in index a8ab0b8..491198e 100755 --- a/templates/lxc-kali.in +++ b/templates/lxc-kali.in @@ -121,6 +121,17 @@ EOF # set the hostname cat <<EOF > $rootfs/etc/hostname $hostname +EOF + + # set minimal hosts + cat <<EOF > $rootfs/etc/hosts +127.0.0.1 localhost +127.0.1.1 $hostname + +# The following lines are desirable for IPv6 capable hosts +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters EOF # reconfigure some services