1

I have a problem with a new server with Ubuntu 18.04.

I try to change the host name more times, with different method, like editing /etc/hostname or hostnamectl --set-hostname ecc ecc. But when I reboot the machine the host name return to old setting. Can you help me?

I've a host with incorrect name like:

root@viper:~# cat /etc/hostname    
viper 

I tried to change hostname:

root@viper:~# hostnamectl set-hostname titan --static 

But when I reboot the host the hostname return back to viper.

I also try to edit, with vi/nano the file /etc/hostname and /etc/hosts changing viper to titan.

It'works for current session, but when I reboot the hostname return viper :(

Maybe I'was not clear. The problem is not how to change the hostname, but how to make it persistent. The filesystem is not readonly I'm sure:

/dev/sda2 on / type ext4 (rw,relatime,data=ordered)

0 Answers0