Why Does My Servers Hostname Keep Changing?

Why does my servers hostname keep changing?

Cloud-init sets the hostname on each reboot, if your hostname is not configured to be persistent it will be reset on each reboot. Here is how to ensure that your hostname is persistent and remains after a reset:


Setting hostname via cloud-init:

Simply set the hostname via cloud-init, please refer to the cloud-init documentation here. Once you have done this, the hostname will always be set to the desired name after a restart.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article

Modified on Fri, 4 Oct at 4:14 PM

Can’t find what you’re looking for?

Get in Touch

Do you have a pre-sales question?