Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How does /etc/hosts get created on RHEL 5.5? It's not owned by any RPM and if deleted, it doesn't reappear on reboot, so apparently it's not a service created it. Does anaconda create it by default maybe? I'm trying to figure out exactly when during the install it's created. I'm assuming it must be created by anaconda before installing the RPMs?

share|improve this question
up vote 2 down vote accepted

Yes for RHEL 5 /etc/hosts is created by anaconda, see the anaconda source for details.

Later versions (RHEL 6) seem to use the setup.rpm to install /etc/hosts.

share|improve this answer
Thanks for the link proving my assumption and I look forward to the change in RHEL 6; I think that's better. – deuberger Aug 8 '12 at 12:56

You're correct that anaconda is responsible for creating this file. See /usr/lib/anaconda/network.py for details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.