Ubuntu : retain host-name change after a reboot


The newly set hostname reverts back to older one after reboot

Reason :

Hostname is reset by cloud-init

Solution :

Inactivate cloud-init.

On terminal, key in –

hostnamectl set-hostname YourNewHostName
sudo touch /etc/cloud/cloud-init.disabled
sudo reboot

Leave a Reply

Your email address will not be published. Required fields are marked *


* Copy This Password *

* Type Or Paste Password Here *

68,488 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>