Page 1 of 1

How to change the computer name on Ubuntu/Linux

Posted: Tue Aug 30, 2011 6:30 pm
by Saman
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)