October 18, 2019

How to Change Ubuntu Computer Name (Hostname)

This quick tip is going to show Ubuntu beginners how to change the hostname (computer name) in Ubuntu 19.10 Eoan Ermine.

Change hostname in Ubuntu permanently:

There are a few graphical utilities offer option to change the computer name depends on your running desktop environment.

The universal way is to edit the configuration file /etc/hostname:
1. Open terminal from application menu, and run command to edit the file:
sudo gedit /etc/hostname
You may replace gedit with nano for Ubuntu Server, or with other text editor for your DE.
When the file opens, replace the content with your new computer name.


2. To avoid networking issue, you HAVE TO edit the hosts file and replace the old computer names.
Open terminal (Ctrl+Alt+T) and run command:
sudo gedit /etc/hosts
Also you may replace gedit with your favorite text editor.

No comments:

Post a Comment