Skip to main content

Posts

Showing posts from September, 2018

Changing the host name on Ubuntu 18.04

I cloned an Ubuntu 18.04 Server instance post which I wished to change the hostname of the new instance. What was supposed to be a simple operation of updating the hostname in the /etc/hostname and running sudo hostname <new hostname> didn't work as expected. The hostname used to revert on reboot. It took me quite some time to arrive at the right solution. An Ask Ubuntu answer set me in the right direction though it did not work as-is. The reason is the shipment of cloud-init in Ubuntu 18.04. I got it to work with the following steps -