Introduction to Linux - A Hands on Guide | Linux Bible | Linux From Scratch | A Newbie's Getting Started Guide to Linux | Linux Command Line Cheat Sheet | More Linux eBooks



Sunday, 27 October 2013

How To : Change the Host Name (Computer Name) in Ubuntu Linux


     Whenever you install the Ubuntu operating system in your computer, the host name is fixed to a default name which may not be desired to you. No worries though, you can change it by editing a couple of files. This tiny article will guide you to change the host name of your Ubuntu system.

Step 1: Check your current host name by running following command in terminal:

hostname

Result : hostname


Step 2: To change the existing host name, edit /etc/hosts and /etc/hostname files with your favorite text editor.

sudo gedit /etc/hostname /etc/hosts

You will observe two files opened in the text editor. You can edit the underlined part shown in the images below to set the desired host name.

Edit 'hosts' file

Edit 'hostname' file


Step 3: After editing those files, save them and reboot the system for the changes to take effect.

Result

0 comments:

Post a Comment