Ubuntu: How to Change the Computer Name

Contributor Icon Contributed by shamanstears Date Icon January 7, 2008  
Tag Icon Tagged: Linux

You might run into a situation that requires you to change your computer name, either because you need it to meet a naming scheme or you’re just bored with it and want something better. By following these steps, you’ll give your computer a new identity in no time.


1. Open a terminal window.

2. Input the following command and hit Enter:
gksudo gedit /etc/hostname

3. When prompted, enter the administrator password and click the OK button.

4. The hostname file will open, displaying the current computer name. Replace the current computer name with the desired new name.

5. Click Save.

6. Close all open windows and restart your system.

After your system has restarted, it will have the new computer name.

Previous recipe | Next recipe |
 
  • Anonymous
    You'll also want to edit /etc/hosts

    127.0.0.1 localhost hostname
    127.0.1.1 hostname


    if you don't make those changes it has the possibility of slowing your machine to an absolute crawl. I say this only because I changed my hostname the same way as your tip and Gnome became about as slow as molasses in a Montana winter.
  • ubu-fan
    hey thnx for the tutorial, worked like a charm ;)
  • kumareshane1986
    its working pretty cool...
  • Rahul
    Thanks
  • Lurker
    I would change the /etc/hosts first if you don't the machine can not create a window. Otherwise works great on Ubuntu 9.04
blog comments powered by Disqus