From: Lenz Grimmer Date: Fri, 12 Jun 2015 23:08:41 +0000 (+0200) Subject: use `hostname` for DHCP_HOSTNAME in ifcfg-eth0 X-Git-Tag: lxc-1.0.8~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d690bdd402b53de89a53330ef880eb5e95b32bb8;p=thirdparty%2Flxc.git use `hostname` for DHCP_HOSTNAME in ifcfg-eth0 Updated centos/fedora/oracle templates to use `hostname` for DHCP_HOSTNAME in /etc/sysconfig/network/ifcfg-eth0, so the container's host name is propagated to the host's DHCP server (e.g. dnsmasq, which also acts as the DNS server). This resolves lxc/lxd#756 Signed-off-by: Lenz Grimmer --- diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in index 282e3a593..802e95101 100644 --- a/templates/lxc-centos.in +++ b/templates/lxc-centos.in @@ -247,7 +247,7 @@ HOSTNAME=${UTSNAME} NM_CONTROLLED=no TYPE=Ethernet MTU=${MTU} -DHCP_HOSTNAME=$name +DHCP_HOSTNAME=\`hostname\` EOF # set the hostname diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in index 26fe57fa2..68eecdef0 100644 --- a/templates/lxc-fedora.in +++ b/templates/lxc-fedora.in @@ -220,6 +220,7 @@ DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes HOSTNAME=${utsname} +DHCP_HOSTNAME=\`hostname\` NM_CONTROLLED=no TYPE=Ethernet MTU=${MTU} diff --git a/templates/lxc-oracle.in b/templates/lxc-oracle.in index 97a3a2a89..daaa63d31 100644 --- a/templates/lxc-oracle.in +++ b/templates/lxc-oracle.in @@ -290,7 +290,7 @@ DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes HOSTNAME=$name -DHCP_HOSTNAME=$name +DHCP_HOSTNAME=\`hostname\` NM_CONTROLLED=no TYPE=Ethernet EOF