Results 1 to 10 of 10
Hi
I have a vitual private server with fedora core 2 installed
I would like to perminatly change the hostname
I have edited /etc/hosts and /etc/sysconfig/network and changed the hostname
...
- 11-11-2005 #1Just Joined!
- Join Date
- Oct 2005
- Posts
- 8
Permintally changing host name
Hi
I have a vitual private server with fedora core 2 installed
I would like to perminatly change the hostname
I have edited /etc/hosts and /etc/sysconfig/network and changed the hostname
After a reboot the files seem to revert back to the old hostname
Can anyone advise if there is nothing I can do can I right a script that will run on statup to set the hostname.
Thanks in advance
- 11-11-2005 #2
use this tool as root:
system-config-network
the hostname is specified on the 'DNS' tab.Linux user #126863 - see http://linuxcounter.net/
- 11-11-2005 #3Just Joined!
- Join Date
- Oct 2005
- Posts
- 8
no that doesnot work after a reboot it defaults back to the old hostname
I can not understand it
- 11-11-2005 #4
Try the
command.Code:hostname new_name_here
Are you updating the hostname via dhcp by any chance?
- 11-11-2005 #5Just Joined!
- Join Date
- Oct 2005
- Posts
- 8
hostname new-name is only temporary until re-boot
thanks anyway
box has a static ip and is a vitual server
- 11-12-2005 #6Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,043
I'd have done exactly what you've done to change the hostname, so the fact that it's not working is a mystery to me. Have you got anything in /etc/hostname? If you have, and it's the old name, just delete the file and see if that resolves your problem.
- 11-12-2005 #7Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,043
I'd have done exactly what you've done to change the hostname, so the fact that it's not working is a mystery to me. Have you got anything in /etc/hostname? If you have, and it's the old name, just delete the file and see if that resolves your problem.
- 11-12-2005 #8Just Joined!
- Join Date
- Oct 2005
- Posts
- 8
scm
yes I know. I will contact my provider and ask them why.
the only reason I want to change it permintally is that when I reboot the box and forget to manually change it my hostname is not a register domain so all my e-mail get returned
If theyt give me an answer i will post it
thanks to everybody for their sudgestions
- 10-05-2006 #9Just Joined!
- Join Date
- Oct 2006
- Posts
- 1
Changing Linux Hostname
Guys you need to edit the following files:
/etc/hosts
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0 (depends on NIC name)
then reboot.
- 07-17-2007 #10Just Joined!
- Join Date
- Jul 2007
- Posts
- 3
Your recipe worked -- but not until I rebooted. Restarting the network did not do it.



