Ubuntu – Change the computer name

To rename a computer running Ubuntu you have to edit the hostname file located in the following directory:


To do this, run the following command:

sudo nano /etc/hostname

You then have to reboot the system by issuing the following command:

sudo reboot

When the server comes back up it will have the new hostname.  Some interesting things worth noting:

  • nano is a text editor that comes as a standard part of the Ubuntu server build. VI appears to have a steep learning curve at first glance. I’ll revisit it later.  For now this should do the trick.
  • As opposed to Windows, it does not appear that Ubuntu is going to check and see if there is already a machine on the network with the same name. I’ll need to be careful about this or risk multiple machines with the same name on the network, which could be a DNS headache.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: