Ubuntu: Changing Your Computer's Name

Written by:  • Edited by: J. F. Amprimoz
Updated Jul 6, 2011
• Related Guides: Text Box | Graphical User Interface | Ubuntu

Did you know your computer has a name? Occasionally you may need to rename your computer for security or personal reasons. Ubuntu makes it easy to rename your computer, so you can spend more time doing creative things – Like choosing a name!

There are several practical reasons you may need to rename your computer system:

  • Maybe you're using your personal laptop for work. Some networks will require all computers on the network to be named using specific guidelines.
  • Or, perhaps you've purchased a used computer, and the computer name is not to your liking.
  • It's even possible several members of your household gave their computers similar names. This could get confusing when you network them together.

Whatever your reason, renaming your computer in Ubuntu is a simple process.

These instructions have been tested on Ubuntu 8.04, also known as Hardy Heron.

Instructions for other releases of Ubuntu may be slightly different.

Using GUI

GUI stand for Graphical User Interface. This is the desktop interface Windows users are intimately familiar with.

  1. From your toolbar, select System ->Administration -> Network
    network
    click to enlarge
  2. Select the General tab.
  3. If you are not logged in as Root, select Unlock.
  4. A window will open, asking you to verify you have permission to access this part of the system. Type your password into the textbox, and click Authenticate.
    Screenshot-Network Settings
    click to enlarge
  5. Type your desired computer name in the text box labeled Host Name.
  6. Click Close

Restart your system to ensure the changes take effect.

Congratulations! You're computer now has a brand new name.

Using Command Terminal

The Command Terminal allows you to control your computer by typing a series of commands in the box.

  1. Open your command terminal by selecting Applications - > Accessories - > Terminal.
  2. Type gksudo gedit /etc/hostname into the command terminal, and press Enter on your keyboard.
  3. Enter your administrative password in the text box. Click OK
  4. A window will open titled hostname (/etc) – gedit. Replace your system's current name with the new one.
  5. Select Save from the tool panel at the top of the window.
  6. Close the Command Terminal.
  7. Restart your system.

Comments

Showing all 6 comments
 
Clint Dolenz Dec 12, 2011 1:29 PM
RE: Ubuntu: Changing Your Computer's Name
Thank you! -- Helps out quite a bit!
Clint Dolenz Dec 12, 2011 1:29 PM
RE: Ubuntu: Changing Your Computer's Name
Thanks! Helps big time!
thomas Feb 25, 2010 4:55 PM
Renaming from the terminal
In reply to Steve's comment, in the last Ubuntu release (9.10), it fixes /etc/hosts for you after you change /etc/hostname from the terminal. Some other distros might do that too.
Nazwan Sep 13, 2009 3:05 PM
for Linux Mint
@gem

For Linux Mint, just follow the instructions using command terminal. Like Steve said, you should also update your new hostname in /etc/hosts then run /etc/init.d/hostname.sh and reboot.
gem Jul 14, 2009 6:52 AM
how do you change the computer's name in Linux Mint?
hi, how do you change the computer's name in Linux Mint?

i tried googling it, but the only instructions i saw were for Ubuntu.

i can't find Network on Mint. just Network Tools.

thanks!
Steve Jackson Jul 14, 2009 5:55 AM
Renaming from the terminal
In the command-line method of changing the computer name, as well as changing the machine name in /etc/hostname, you should replace all occurrences of the old name with the new name in the file /etc/hosts - otherwise you may not be able to log on to the GUI after reboot.
 
blog comments powered by Disqus
Email to a friend