System has configured 'manage_etc_hosts' as True

April 8, 2015 3.2k views
Configuration Management DNS Apache


I had created an Ubuntu 14.04 x64 droplet. I have a warning message in top of my /etc/hosts file.

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data

before that in my other droplets when I want to set a sub-domain first I create the 'a records' in digital ocean panel then config my web server virtual hosts and then set up my domain details in /etc/hosts file. now I don't change /etc/hosts but everything is ok and my virtual hosts work successfully.
I try to find manage_etc_hosts option for changing it but I didn't find it.
let me now if it's bad problem or no ? if yes how can I fix it ?

tnx a lot.

4 Answers

Those comments can be safely ignored. They are an artifact of how networking is initially set up on the first boot using Cloud-Init. After first boot, you should be able to manage /etc/hosts as you would normally expect.

I'm starting to see this on new Ubuntu droplets, and find it VERY confusing. Is this something that DigitalOcean recently implemented? And if so, why would they leave that message in there if it's just an artifact and is not accurate? It's stuff like this that takes the fun out of server management.

Confirmed: It does appear to be an artifact. Rebooting the server does not cause edits to be lost.

This appears NOT to be an artifact. I have Debian installed and when I change the /etc/hosts, it change back after reboot, again and again. I've followed the instructions by adding the host to /etc/cloud/templates/hosts.tmpl but doesn't seems to have any effect either

I was able to fix mine by editing /etc/cloud/templates/hosts.debian.tmpl with the host info.

Have another answer? Share your knowledge.