How to change the computer name on Ubuntu/Linux

Linux OS Topics
Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to change the computer name on Ubuntu/Linux

Post by Saman » Tue Aug 30, 2011 6:30 pm

Follow these steps to change the hostname (Computer name) in Ubuntu.
  1. Execute sudo hostname host.domain, replace host.domain with your hostname, example: notebook.robot.lk
  2. Edit the /etc/hosts file

    Code: Select all

    gksu gedit /etc/hostname
  3. Edit the /etc/hostname file.

    Code: Select all

    gksu gedit /etc/hosts
  4. Edit the /etc/resolv.conf file if needed.

    Code: Select all

    gksu gedit /etc/resolv.conf
  5. Reboot the server (highly recommenced although not required)
Post Reply

Return to “Linux”