Rename Ubuntu Server

So, you just screwed up the name of your Ubuntu server?

Well that can be changed in no time and with no downtime

Just follow the below steps;

  • Set a new hostname
sudo hostname new.host.name
  • Edit the /etc/hosts file

sudo vi /etc/hosts

  • Edit the /etc/hostname file

sudo vi /etc/hostname

In some circumstances you may also have to change the /etc/resolv.conf file.

  • prove that it works

sudo reboot

Simple, yes! But worth 90 seconds to write out ;P


Tag Cloud