Automatically generated /etc/hosts is wrong
- by Niels Basjes
I've created a kickstart script to install CentOS 5.5 (32bit) in a fully automated way.
The DNS/DHCP setup correctly gives the system the right hostname in both the forward and reverse lookups.
dig node4.mydomain.com. +short
10.10.10.64
dig -x 10.10.10.64 +short
node4.mydomain.com.
In the state the installed system is right after the installation completed is as follows:
cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
GATEWAY=10.10.10.1
HOSTNAME=node4.mydomain.com
echo ${HOSTNAME}
node4.mydomain.com
cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.10.10.64 node4
My problem is that this automatically generated hosts file is slightly different from the way I want it (or better: the way Hadoop wants it).
The last line should look like this:
10.10.10.64 node4.mydomain.com node4
What do I modify where to fix this?
Thanks.