How to Change Hostname (Computer Name) in Ubuntu 13.04

Last updated: August 6, 2013

Here’s a beginners’ guide to change your hostname or computer name in Ubuntu 13.04 Raring Ringtail. The default PC name was set when you were installing Ubuntu. You can easily change it to whatever you want both in Ubuntu Server and Desktop with this tutorial. To check your current name, go to top-right corner “gear” button -> About This Computer.

ubuntu hostname

Change Hostname in graphical way:

There’s a graphical tool called gnome-network-admin, it provides a simple way to change your computer name in Ubuntu Desktop.

change hostname in gui

You can search for and install this tool from Ubuntu Software Center. Or click the link below to launch it:

click to install gnome-network-admin

Change Hostname in Command Line:

If you’re comfortable with editing a configuration file and running some terminal commands it’s not difficult to change your PC name manually.

To check current hostname, run below commands:


To set a hostname until you restart, run:

sudo hostname YOUR_NEW_NAME

To change your computer name permanently, edit both /etc/hostname and /etc/hosts with your favorite editor and change your previous name to whatever you want.


I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected]

2 responses to How to Change Hostname (Computer Name) in Ubuntu 13.04

  1. I am new to this.
    Your notes helped.
    Thank you.

  2. Thank you :-)