We have our servers running CentOS 4.9. I want to find how
/etc/hosts file is created during installation.
A related question here (What creates /etc/hosts (RHEL 5.5)) says that in RHEL 5
/etc/hosts file is created by ananconda.
anaconda-10.1.1.46-4.x86_64.rpm. I extracted this RPM and found a file
/usr/lib/anaconda/network.py. This Python file creates the
After reading through this python script I could see that
localhost.localdomain domain alias name should be added in the
But during installation I could see that the
/etc/hosts file is created with only.
We also have an
ks.cfg file which creates
/etc/hosts file with the following content
127.0.0.1 localhost loghost
So after installation and reboot, the
/etc/hosts file is created as specified in the
I am bit confused here how the
/etc/hosts file is created with only
127.0.0.1 loghost during installation.
Note: We bundle our application RPMs with the CentOS rpms and build an ISO.
The real problem is we are moving from CentOS 4.9 to 6.5. In CentOS 6.5 setup-2.8.14-20 rpm creates the hosts file with the following contents
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
localhost.localdomain is added in the hosts file.
So we are trying to find the difference between CentOS 4.9 & 6.5
/etc/hosts file creation during installation, because our application is tightly bound with the entries in