Operating System - Linux
1827447 Members
5691 Online
109965 Solutions
New Discussion

Re: my system won't let me change host name ..

 
SOLVED
Go to solution
eugene_6
Advisor

my system won't let me change host name ..


oneday i changed my hostname to "localhostelocaldomaine"
(out of curiousity)
u
now, i can't get back to "localhost" or whatever i want..

grep -r localhostelocaldomaine /etc/*
gives me:

/etc/dhcpc/dhcpcd-eth0.info:HOSTNAME=localhostelocaldomaine

what should i do?

thx a bunch
2 REPLIES 2
I_M
Honored Contributor
Solution

Re: my system won't let me change host name ..

Hi

I am not sure which distribution you are using.
Assuming you are using RedHat flavor's one, the hostname configuration is under /etc/sysconfig/network, /etc/hosts, /etc/HOSTNAME.
If you want to change the hostname, you must change these 3 files at a same time.
Then reboot the system.
This is how to change static IP & Hostname.

If you are using DHCP, your DHCP server assign hostname,IP address and routing information.

Good luck
eugene_6
Advisor

Re: my system won't let me change host name ..

thank you...........

i tried
hostname command
and various other things.

3files at the same time..
--;
this kind of info can be obtained by reading howto douments? or by experience?

thx a bunch