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)

  • If that doesn't help could you please add a little more detail? What *exactly* did you do, what did you expect to happen and what happened instead? Did you encounter any warning or error messages? Please reproduce them *in their entirety* in your question. You can select, copy and paste terminal content and most dialogue messages in Ubuntu. Please also make sure that `/etc/hostname` resides on a *persistent and writeable* file system. Please **[edit]** your post to add information instead of posting a comment. (see [How do I ask a good question?](/help/how-to-ask)) – David Foerster Apr 11 '18 at 10:30
  • [Ubuntu Development version / How to participate](https://askubuntu.com/questions/1018033/ubuntu-development-version-how-to-participate) – sudodus Apr 11 '18 at 10:34

0 Answers0