Hostname, Change Your

From PCLinuxOSHelp Knowledge Base
Revision as of 07:23, 13 December 2021 by Dwmoar (talk | contribs) (Web page is in the process of being updated to reflect the use of the NetworkManager and NMCLI -- Network config in PCC no longer exists.)
Jump to: navigation, search

How To Change your hostname

This webpage is being updated

As in most everything in Linux, there are many different ways that you can do something. In this HowTo, I will list just a couple ways that you can change your hostname.

First we will look at changing our hostname using PCC (The PCLOS Control Center)

In your task bar look for the PCC logo Pcc.png Click on it to open PCC


In the left hand pane click on "Network & Internet" than in the right hand pane select "Host Definitions"


It will open a window that will display the current information. There should be two entries displayed. We are only interested with the first entry "localhost.localdomain"


Click on that entry to highlight it and than click on the "Modify" button to the right side of the window. This will open a "Modify Entry" box.


The only changes we want to make in this box is to the "Host Name" and the "Host Aliases" lines.

In the "Host Name" line add the name you are going to use. As for my example I am using workbox.


My entry should now look like this


In the "Host Aliases" line, which should be blank I enter my hostname. Again in my example I entered


When you have finished, click "OK" The window will close. You should notice that your host name has now changed.


If everything is correct than click "OK" at the bottom left of the window. If something is not right repeat the above process till it is correct.

We can now close out the PCC window.

You have now changed your hostname. Be aware that your changes WILL NOT show up till after you restart your computer.

Changing Your Hostname yet another way

From your desktop press the "Alt" key and "F2" key. This will open a window at the top of you screen.


In the line enter

kdesu kwrite


or use your favorite text editor. When you are finished press enter. After a few moments, you should than be greeted with a password dialog box.


In this box enter your root users password, when you are done press OK.


Your text editor should now open. In our example "kwrite" will open.


Click on the "OPEN" button and open the following file.



We are only interested in on line in this file. This is the first line starting with


Now we want to change it to reflect our new hostname. In this example we want to change it to read.




When you have finished click on "SAVE" Once saved you can than close your editor. Your changes will now take effect the next time you reboot your computer.

Also Note: I've found that I need to add DHCP_HOSTNAME=<myhostname> to /etc/sysconfig/network for my router to "see" the hostname.