diff --git a/hooks/centos4/50-setup-hostname b/hooks/centos4/50-setup-hostname index 6c03aa2..857e4e7 100755 --- a/hooks/centos4/50-setup-hostname +++ b/hooks/centos4/50-setup-hostname @@ -64,9 +64,15 @@ if [ -z "${dhcp}" ]; then else - logMessage Adding ${hostname} to /etc/hosts on the host + # + # Short host name. + # + name=`echo ${hostname} | awk -F. '{print $1}'` + + logMessage Adding ${hostname} and ${name} to /etc/hosts on the host + + echo "${ip1} ${name} ${hostname}" >> /etc/hosts - echo "${ip1} ${hostname}" >> /etc/hosts # # If we've updated the /etc/hosts file on the host machine diff --git a/hooks/dapper/50-setup-hostname b/hooks/dapper/50-setup-hostname index 3e1a565..a98ab31 100755 --- a/hooks/dapper/50-setup-hostname +++ b/hooks/dapper/50-setup-hostname @@ -64,9 +64,15 @@ if [ -z "${dhcp}" ]; then else - logMessage Adding ${hostname} to /etc/hosts on the host + # + # Short host name. + # + name=`echo ${hostname} | awk -F. '{print $1}'` + + logMessage Adding ${hostname} and ${name} to /etc/hosts on the host + + echo "${ip1} ${name} ${hostname}" >> /etc/hosts - echo "${ip1} ${hostname}" >> /etc/hosts # # If we've updated the /etc/hosts file on the host machine diff --git a/hooks/debian/50-setup-hostname b/hooks/debian/50-setup-hostname index 3e1a565..127d3e4 100755 --- a/hooks/debian/50-setup-hostname +++ b/hooks/debian/50-setup-hostname @@ -64,9 +64,14 @@ if [ -z "${dhcp}" ]; then else - logMessage Adding ${hostname} to /etc/hosts on the host + # + # Short host name. + # + name=`echo ${hostname} | awk -F. '{print $1}'` - echo "${ip1} ${hostname}" >> /etc/hosts + logMessage Adding ${hostname} and ${name} to /etc/hosts on the host + + echo "${ip1} ${name} ${hostname}" >> /etc/hosts # # If we've updated the /etc/hosts file on the host machine diff --git a/hooks/edgy/50-setup-hostname b/hooks/edgy/50-setup-hostname index 3e1a565..f8dd9c4 100755 --- a/hooks/edgy/50-setup-hostname +++ b/hooks/edgy/50-setup-hostname @@ -63,10 +63,14 @@ if [ -z "${dhcp}" ]; then logMessage Host already has IP address for the host ${hostname}. else + # + # Short host name. + # + name=`echo ${hostname} | awk -F. '{print $1}'` - logMessage Adding ${hostname} to /etc/hosts on the host + logMessage Adding ${hostname} and ${name} to /etc/hosts on the host - echo "${ip1} ${hostname}" >> /etc/hosts + echo "${ip1} ${name} ${hostname}" >> /etc/hosts # # If we've updated the /etc/hosts file on the host machine diff --git a/hooks/gentoo/50-setup-hostname b/hooks/gentoo/50-setup-hostname index abaa216..0a2c456 100755 --- a/hooks/gentoo/50-setup-hostname +++ b/hooks/gentoo/50-setup-hostname @@ -71,9 +71,14 @@ if [ -z "${dhcp}" ]; then else - logMessage Adding ${hostname} to /etc/hosts on the host + # + # Short host name. + # + name=`echo ${hostname} | awk -F. '{print $1}'` - echo "${ip1} ${hostname}" >> /etc/hosts + logMessage Adding ${hostname} and ${name} to /etc/hosts on the host + + echo "${ip1} ${name} ${hostname}" >> /etc/hosts # # If we've updated the /etc/hosts file on the host machine