Pinterest Stumbleupon Whatsapp
Ads by Google

change computer name in ubuntuMakeUseOf has posted free PDF manuals for users interested in switching to Linux because there are many good reasons to 5 Reasons A Disgruntled Windows User Should Consider Using Ubuntu 5 Reasons A Disgruntled Windows User Should Consider Using Ubuntu Read More . The desktop customization options are endless 5 Tools And Tips For A Sexier Ubuntu Interface 5 Tools And Tips For A Sexier Ubuntu Interface Read More , and so it’s not hard to modify bits of your computer, whether you’re in LTS Lucid Ubuntu 10.04 - An Extremely Simple Operating System [Linux] Ubuntu 10.04 - An Extremely Simple Operating System [Linux] Read More (check this post Why Are There So Many Versions of Ubuntu? [Technology Explained] Why Are There So Many Versions of Ubuntu? [Technology Explained] Read More to understand why there are so many different versions of Linux) or Karmic, for which there is a comprehensive and free PDF manual The Incredible Guide to NEW Ubuntu Karmic Koala [PDF] The Incredible Guide to NEW Ubuntu Karmic Koala [PDF] Read More .

Today, we’ll go over a small tip involving how to modify the computer name, which you were able to set when you installed Ubuntu.


You might want to change the computer name for a number of reasons: Perhaps you want to shorten the name, or maybe there was a typo in the old computer name. Whatever it is, be sure to see the following instructions, which were tested in Ubuntu 10.10, a fun OS 6 Fun Ways To Explore Ubuntu 10.10 [Linux] 6 Fun Ways To Explore Ubuntu 10.10 [Linux] Read More which we have explored here What's New In Ubuntu 10.10, "Maverick Meerkat"? [Linux] What's New In Ubuntu 10.10, "Maverick Meerkat"? [Linux] Read More , although these will probably work for 10.04 too. For earlier editions or versions of Ubuntu, check these instructions that don’t require the use of the command line.

  • First, press Alt-F2 to bring up the Run dialog. Type the following:
gksu gedit /etc/hostname
  • and hit Run.

change computer name in ubuntu

  • Type your administrator password when you’re prompted, and click OK. You’ll see a gedit text editor window open, displaying your current computer name. Replace the text with your desired name. Remember to hit Ctrl+S to save your file before closing the file.

ubuntu computer name change

  • Now bring up the Run dialog again by pressing Alt-F2. This time, type:
gksu gedit /etc/hosts

ubuntu computer name change

Ads by Google
  • If you get a prompt to type your administrator password, do so to proceed, but it’s possible you might not even get that prompt before the hosts file loads up in gedit. Now locate the last line of the first block of text and replace the text with the name you chose earlier. Hit Save when you’re done correcting.

  • Close the file and restart the system. Once you’re back on your desktop, open a terminal window and verify that you have your new computer name at the header.

ubuntu computer name change

You should be all set if you use Ubuntu’s default web browser, Firefox. If however you use Google Chrome or Chromium, you may receive an error message that prevents the browser from opening after the system restart. I renamed the computer at least twice for this article and only got the error message after the first system renaming test.

ubuntu computer name change

If you did get the error message, read on.

  • To get Google Chrome or Chromium up and running again, bring up the handy Run dialog again and type what’s next:
/home/YOUR_USERNAME/.config/google-chrome
  • OR
/home/YOUR_USERNAME/.config/chromium/

ubuntu computer name change

  • Find and delete the SingletonLock file.

change computer name in ubuntu

  • Open up Google Chrome or Chromium as either one should now run like normal in your freshly-renamed computer.

Additional commenters from all over the web recommend doing “sudo hostname [NEW COMPUTER NAME]” on the terminal, which seems to only tease with a temporary change as the new name is nowhere to be seen after a reboot. I’ve also seen suggestions to restart the hostname service, but that hasn’t worked for me.

Do you know of other ways, perhaps more convenient ones or ones that don’t require a system restart, to change your computer’s name in Ubuntu? Share your nuggets of wisdom in the comments!

Image credit: rafa espada

  1. Josh Fox
    March 17, 2011 at 1:52 pm

    Ubuntu Tweak ( http://ubuntu-tweak.com ) makes it easy to change the computers name without manually editing configuration files. It's located under the "System" category on the left side. However, I haven't found any way to change the computer's name in any operating system without restarting the computer. The restart refreshes the network connection, giving the network the computer's new name. I'm not real sure why it does this since you should be able to simply restart the network connection to do it, unless the computer's name is loaded into the RAM and has to be cleared and refreshed by the restart.

    • Jessica Cam W.
      March 17, 2011 at 9:30 pm

      Wish I thought of using UT. That makes perfect sense. Thanks for the tip!

    • The Negative Shape
      March 22, 2011 at 5:39 pm

      I'd use Ailurus in addition to Ubuntu Tweak. Both are great programs and fill each other's gaps.

      • Josh Fox
        March 22, 2011 at 5:45 pm

        I agree. I keep both installed, but I think Ubuntu Tweak has the more direct way to rename the computer between the two. However, I don't like how Ailurus handles package installation with one command for each package instead of combining the different packages into a single command. Other than that, they do compliment the other quite well.

      • Jessica Cam W.
        March 22, 2011 at 8:36 pm

        Ailurus is new to me! Keep the awesome suggestions coming :)

  2. Josh Fox
    March 17, 2011 at 2:52 pm

    Ubuntu Tweak ( http://ubuntu-tweak.com ) makes it easy to change the computers name without manually editing configuration files. It's located under the "System" category on the left side. However, I haven't found any way to change the computer's name in any operating system without restarting the computer. The restart refreshes the network connection, giving the network the computer's new name. I'm not real sure why it does this since you should be able to simply restart the network connection to do it, unless the computer's name is loaded into the RAM and has to be cleared and refreshed by the restart.

  3. Arjun Bajaj
    March 17, 2011 at 9:37 am

    great tip... i have always wanted to know from where to rename the system without reinstalling it... and great tutorial too. thanks...

  4. Siva
    March 17, 2011 at 4:05 am

    How to change the OS name(Ubuntu to MyName) when it is booting via GRUB installer.

  5. Jessica Cam W.
    March 17, 2011 at 5:38 am

    I think this guide should help (just make sure you make a backup for the
    original file):
    http://www.howtogeek.com/howto...

  6. bob
    March 17, 2011 at 2:18 am

    nice theme... what is it? :D

    • Jessica Cam W.
      March 17, 2011 at 2:29 am

      That would be Radiance, which is included in Ubuntu 10.04 and on.

Leave a Reply

Your email address will not be published. Required fields are marked *