How to change the computer name on Ubuntu/Linux
Posted: Tue Aug 30, 2011 6:30 pm
Follow these steps to change the hostname (Computer name) in Ubuntu.
- Execute sudo hostname host.domain, replace host.domain with your hostname, example: notebook.robot.lk
- Edit the /etc/hosts file
Code: Select all
gksu gedit /etc/hostname
- Edit the /etc/hostname file.
Code: Select all
gksu gedit /etc/hosts
- Edit the /etc/resolv.conf file if needed.
Code: Select all
gksu gedit /etc/resolv.conf
- Reboot the server (highly recommenced although not required)