Kickstart and /etc/hosts

When performing a Kickstart installation, anaconda populates /etc/hosts differently based on whether the hostname is resolvable (i.e. there is a DNS A record for the hostname).

Example network line in Kickstart file:

network --device eth0 --bootproto static --ip 192.168.1.100 --netmask 255.255.255.0 --gateway 192.168.1.1 --nameserver 192.168.1.50 --hostname host.example.com

During the "Performing post install configuration..." section of the Kickstart installation, anaconda performs a DNS A query to --nameserver for --hostname.

If host.example.com is resolvable, i.e. has a DNS A record, /etc/hosts will appear like:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
192.168.1.100           host.example.com host

If host.example.com is unresolvable, /etc/hosts will appear like:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               host.example.com host localhost.localdomain localhost

If you know Python, examine the anaconda source (/usr/lib/anaconda/network.py) for the actual logic.

Back to brandonhutchinson.com.
Last modified: 2007/01/23