Tag Archives: reboot

Rackspace Cloud – .localdomain added in /etc/hosts after reboot

There is an agent called “nova-agent” which runs on all Rackspace cloud virtualised servers. This agent handles all communication between the hypervisor and guest OS, and is used for decloning.

Because it is used during decloning, it owns the /etc/hosts file and many files related to DNS and networking (/etc/resolv.conf , /etc/sysconfig/network-scripts/ifcfg-eth0 ,etc)

It is unlikely, but possible, that the host reboot triggered nova-agent to reset your hosts file.

To prevent nova-agent from overwriting your files, you can change the attributes of the file using the following command:

# chattr +i /etc/hosts

This will make the file unwriteable even to root! To remove this restriction, use the following:

# chattr -i /etc/hosts