Your question has been posted! Share it with others to increase its visibility and to get it answered quickly.
Get the latest tutorials on SysAdmin and open source topics.
A question can only have one accepted answer. Are you sure you want to replace the current answer with this one?
You previously marked this answer as accepted. Are you sure you want to unaccept it?
Hub for Good
Supporting each other to make an impact
Write for DigitalOcean
You get paid, we donate to tech non-profits.
Contribute to Open Source
Add comments here to get more clarity or context around a question. To answer a question, use the “Answer” field below.
See the answers over at How to change a droplet name, and all associated configurations?.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart.
If you run into issues leave a comment, or add your own answer to help others.
I renamed the droplet into my primary domain ( somename.com ), what will be the ideal update in /etc/hostname and /etc/hosts
Just curious. Why can’t the hostname be changed automatically in those two places when we perform a rename in the control panel?
From what I understand that would require taking your server down, applying the change, and then taking it back up. Also it could conflict with some other settings you have on your computer, so probably not worth the trouble in most cases. Plus there is no real need for the names to be the same.
Do you mean to reboot Apache or the entire server? sude reboot I guess.
Today (2017) the interface enabling direct name change: at the page of your Cloud Panel (cloud.digitalocean.com/droplets…), simply click on the current name of the Droplet, and you will then be able to input whatever name you choose. Thanks @MikeG.
“also edit your droplet’s hostname internally as well. Update /etc/hostname and /etc/hosts and reboot.”
This is still necessary.
the original image link is offline. Settings > Rename
These settings are gone now…
If you are using CentOS you need to update this file /etc/sysconfig/network
Contents of this file:
so just change HOSTNAME and that’s it
If you are using CentOS you need to update this file /etc/sysconfig/network does not extist on my centos 6.5 droplet.
and neither do etc/hosts or etc/hostnames on my ubuntu droplet
You can type !ref in this text area to quickly search our
full set of tutorials, documentation & marketplace offerings and insert the link!