Ubuntu : retain host-name change after a reboot

Problem:

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 –

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

Kj
Kj [/.] Sreekumar programs computers as a hobby and profession. Into programming from his school days, Sree uses Codemarvels to key in facts and fixes he finds interesting while working on different projects. Some of the articles here give away a few shades of his philosophical leanings too.

Leave a Comment

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