Hostname, Change Your

From PCLinuxOShelp Knowledge Base

Jump to: navigation, search

How To Change your hostname

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


Open-pcc.png


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


Select-network-and-hostname.png


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"


Host-definitions.png


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.


Host-definitions-modify.png


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


Make-changes.png


My entry should now look like this

    workbox.localhost.localdomain

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

    workbox

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


Changes-made.png


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.


Run-command.png


In the line enter
 kdesu kwrite


Enter-command.png


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.


Dialogbox.png


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


Enter-password.png


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


Kwrite-opens.png


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

/etc/sysconfig/network


Select-file.png


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

HOSTNAME=localhost.localdomain

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

HOSTNAME=workbox.localhost.localdomain


Edit-file.png


Named-changed.png


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.

Personal tools