Author Topic: Change hostname PCLinuxOS  (Read 5847 times)

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12493
Change hostname PCLinuxOS
« on: June 21, 2011, 05:56:59 PM »
If you want the hostname to stick even after a reboot in PCLinuxOS there are 2 files to change: the /etc/sysconfig/network and the /etc/hosts:

In the /etc/sysconfig/network I added the line:

HOSTNAME=thenudiebar

Next in the /etc/hosts file I changed the "127.0.0.1 localhost.localdomain localhost" to:

127.0.0.1       thenudiebar localhost

Finally reboot and you will see that the hostname is set.

texstar@thenudiebar ~]$

Thanks to everyone who donates. You keep the servers running.

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10613
  • MLUs Forever!
Re: Change hostname PCLinuxOS
« Reply #1 on: June 21, 2011, 06:32:13 PM »
HOSTNAME=thenudiebar

;D  ;D  ;D
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline GermanTux

  • Hero Member
  • *****
  • Posts: 693
Re: Change hostname PCLinuxOS
« Reply #2 on: July 13, 2011, 01:24:22 PM »
Quote
texstar@thenudiebar

What do geographic locations have to do with changing hostnames? 

Offline KernelKarter

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 270
Re: Change hostname PCLinuxOS
« Reply #3 on: July 14, 2011, 04:46:01 AM »
If you want the hostname to stick even after a reboot in PCLinuxOS there are 2 files to change: the /etc/sysconfig/network and the /etc/hosts:

In the /etc/sysconfig/network I added the line:

HOSTNAME=thenudiebar

Next in the /etc/hosts file I changed the "127.0.0.1 localhost.localdomain localhost" to:

127.0.0.1       thenudiebar localhost

Finally reboot and you will see that the hostname is set.

texstar@thenudiebar ~]$

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

- Eddie
pclinuxos-kde-2013.04 | kernel-3.2.18-pclos2.pae.bfs
- AMD Athlon 64 X2 5000+ CPU
- 4Gb RAM | nVidia 8500GT GPU

Offline Tony

  • Hero Member
  • *****
  • Posts: 1737
  • Reasonable works, ...
Re: Change hostname PCLinuxOS
« Reply #4 on: August 06, 2011, 01:40:55 AM »
I enjoyed that, thanks Mr. Texstar  ;)
*WIKI --PCLinuxOS  is great - remember to Donate ! -- *Software Updates

Offline Vorteggs

  • Hero Member
  • *****
  • Posts: 2399
Re: Change hostname PCLinuxOS
« Reply #5 on: August 06, 2011, 09:26:51 AM »
Me too, thanks!

Some glitches though. It won't take me to "texstar@thenudiebar ~]$" as shown in the Boss example. :'(

Instead I am in Vortex hostname :'(...
Quote
[Vortex@thenudiebar ~]$ su texstar
su: user texstar does not exist
[Vortex@thenudiebar ~]$ su
Password:
[root@thenudiebar Vortex]# su -
[root@thenudiebar ~]#

What should I do for to be in the right place "texstar@thenudiebar ~]$"?
« Last Edit: August 06, 2011, 09:28:23 AM by Vorteks »

Offline Tony

  • Hero Member
  • *****
  • Posts: 1737
  • Reasonable works, ...
Re: Change hostname PCLinuxOS
« Reply #6 on: August 06, 2011, 11:59:20 AM »
You know what Vorteks ( Vortex ), you're not texstar. I think it's that simple  ;D

Actually, when you edited /etc/sysconfig/network, did you "ADD A LINE", or overwrite "HOSTNAME=Vortex" ?
1.) I added a line.
2.) You could over-write the top Line with: HOSTNAME=Texstar, but wouldn't that be a bit creepy, being 'Texstar'.
3.) Each to there own ...  :D
( I'm not one to be giving advice as I just don't know ), but I'm pretty sure Tex wasn't about having everyones Hostname being "texstar@thenudiebar ~]$"

As Texstar wrote:
Quote
In the /etc/sysconfig/network I added the line:

HOSTNAME=thenudiebar

I thought the idea was to change the hostname, which I wouldn't be complaining with:
[root@thenudiebar ~]#     You've done well ;D
*WIKI --PCLinuxOS  is great - remember to Donate ! -- *Software Updates

Offline Vorteggs

  • Hero Member
  • *****
  • Posts: 2399
Re: Change hostname PCLinuxOS
« Reply #7 on: August 06, 2011, 12:04:25 PM »
3.) Each to there own ...  :D
Yep! You got my joke ;D

By the way I am happy I am not Texstar. So much work and strain... :o

 :D

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Change hostname PCLinuxOS
« Reply #8 on: August 06, 2011, 12:09:10 PM »
3.) Each to there own ...  :D

Yep! You got my joke ;D

By the way I am happy I am not Texstar. So much work and strain... :o

 :D


Just a remarq, this man once told me high case and numbers should be avoided in hostnames, because it could produce problems on networks (if you have a lan for instance ?)

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline Vorteggs

  • Hero Member
  • *****
  • Posts: 2399
Re: Change hostname PCLinuxOS
« Reply #9 on: August 06, 2011, 12:24:03 PM »
melodie thanks.
Somehow I fill it and don't use uppercase in the names of files that I consider important. :-\

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Change hostname PCLinuxOS
« Reply #10 on: August 06, 2011, 12:27:56 PM »
melodie thanks.
Somehow I fill it and don't use uppercase in the names of files that I consider important. :-\

Vorteks, you can use any letter case in file names. It's only for the hostname that I was advised not to do so.

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline Vorteggs

  • Hero Member
  • *****
  • Posts: 2399
Re: Change hostname PCLinuxOS
« Reply #11 on: August 06, 2011, 12:33:13 PM »
Yes, though...
I am not Andy but nevertheless I got some kind paranoia too ;)
 :D

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Change hostname PCLinuxOS
« Reply #12 on: August 06, 2011, 12:37:49 PM »
Yes, though...
I am not Andy but nevertheless I got some kind paranoia too ;)
 :D

No problem for me but it was misplaced. You can have high case and low case in name files, you can have it starting with a - or a _ if you wish... some make 2 words as in Windows, usually that works, until you have 2 names alike and want to manipulate them in console, then it becomes a difficult task... ':)
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline Vorteggs

  • Hero Member
  • *****
  • Posts: 2399
Re: Change hostname PCLinuxOS
« Reply #13 on: August 06, 2011, 12:42:10 PM »
Often I find the space in the filenames problematic so I replace it by _.

But this is of-topic and I am sorry for starting it.

Offline dougmack

  • Hero Member
  • *****
  • Posts: 961
Re: Change hostname PCLinuxOS
« Reply #14 on: February 29, 2012, 02:14:35 PM »
I just recently asked this question, and got Texstar's answer as posted here.  I am running the latest 2012 system.  I found that modifying the line that starts 127 was not
necessary: when I went to that file, the modification was there already.  The system must be smart enough to fix itself!   --doug
Blessed are the peacemakers...for they shall be shot at from both sides.  A. M. Greeley