If I create a CentOS 7 droplet using the default DO-supplied image, I note when going to /etc/hosts to add private IP aliases for my other droplets that there’s this:
# 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.redhat.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cfg or cloud-config from user-data
If I look at /etc/cloud/templates/ I see three hosts.OSflaver.tmpl files: debian, redhat, and suse. I tried adding my aliases to all three not knowing/caring which is being sourced and rebooted the droplet. Nothing.
I add the entries directly to /etc/hosts and reboot, they stick despite the warning.
Inspecting /etc/cloud/cloud.cfg reveals some DigitalOcean configuration? Not sure if I need to or should attempt to disable manage_etc_hosts as suggested in the hosts comments, figure out how to use the templates, or what?
Anyone have any advice? For now I’m just using /etc/hosts and ignoring the warning comments. So far it seems okay but it’s likely not.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.