Change Computer Name or Hostname Linux Distro

What is Hostname?

In this article, I will share how to change the computer name or hostname on linux. By default an OS will create a computer name or hostname, which is useful for distinguishing devices on the local network.

Basically the hostname is an IP address, but to make it easier for the user, it is converted to text. This is what can appear when you open the network and see the computers connected into it.

For information, I’m currently using the Pop OS Linux distribution, which is a derivative of Ubuntu Linux. Its use is very easy, stable and lightweight. It is suitable for those of you who are in programmer work.

You can also use the steps below on other Linux Operating System.

To check the computer name, you just need to use the terminal as shown below:

Change Computer Name or Hostname Linux Distro

Or use a command in the terminal:

hostname

it will show the results like this:

neon@pop-os:~$ hostname
pop-os

The result is “pop-os“.

Comand to change Hostname Linux

To change this name, simply edit the file called “hostname” which is in the “/etc” folder.

To do it, we have to open using a text editor in root state.

For example, I open the file using the text editor “gedit” so the command is:

sudo gedit /etc/hostname

The result will open a file like this:

Change Computer Name or Hostname Linux Distro

Now change the text “pop-os” to something else. For example I want to change to the text “linux“, then I save the file.

now logout or reboot your linux distro.

Now, reload the terminal and you will see in the image that the hostname has become “linux”. Pay attention to the following picture:

Change Computer Name or Hostname Linux Distro

hope you can enjoy and benefit from this Change Computer Name or Hostname article. If you want to change Username, I recommended to read this article “How to change username in Linux using terminal”

Change hostname using settings

This way it is very easy to change the hostname. Look at the following picture and follow the steps:

Change Computer Name or Hostname Linux Distro

If you like writing, you can be a guest post on this website, read more here.

Read more:
> Fix Unable to Locate Ubuntu Restricted Extras
> CANNOT ACCESS SPEECH DICTIONARIES FOLDER
> Install deb Linux Operating System Easy Ways
> Ubuntu Unity Still Alive Available at Ubuntu 22.04
> Errors encountered processing google chrome stable

Similar Posts