Renaming hostname in Ubuntu Server 18.04
black3dynamite last edited by black3dynamite
For those who installed Ubuntu Server 18.04 using the new installer from (ubuntu-18.04-live-server-amd64.iso), you will notice that renaming the hostname is not preserved after a reboot.
You'll find that you will need to change
Now you can change your hostname using
sudo hostnamectl set-hostname <new-hostname>and will stay put after a reboot.
Here's a one-liner command to change the preserve_hostname setting to true and to set a new hostname
sudo sed -i '/preserve_hostname: false/c\preserve_hostname: true' /etc/cloud/cloud.cfg; sudo hostnamectl set-hostname YourNewHostname
JaredBusch last edited by
That sounds just stupid.
black3dynamite last edited by
dafyre last edited by
Looks like I will not be using any Ubuntu based systems if I can help it... I'm liking Debian 9 rather well right now.