JoeBannon
01-16-2004, 06:23 PM
My hostname for my server keeps changing to the default from when I first got it from Rack Shack (plain.rackshack.net). I do "hostname www.example.com", but eventually it changes back. How can I lock it in?
Thanks!
It's set by the file /etc/sysconfig/network
If you edit that file, you'll see what to change. However, that won't change things on the web server side, you'll still need to change things in Apache.
JoeBannon
01-16-2004, 06:59 PM
Originally posted by JTY
It's set by the file /etc/sysconfig/network
If you edit that file, you'll see what to change. However, that won't change things on the web server side, you'll still need to change things in Apache.
After I change it, do I need to restart anything or flush stuff?
J.
Restarting would help, as many processes grab the hostname at startup.
ruler
01-16-2004, 07:06 PM
You should reboot the machine, but you can also do a 'svc network restart' and you might be okay too. Rebooting is always a safe option.
blessen
01-17-2004, 05:27 AM
yes
changing the hostname in /etc/sysconfig/network is enough...
but i would suggest you to put the below line in your /etc/rc.local
hostname <your servers hostname>
The above line in your /etc/rc.local will ensure that the server will be booted with the correct hostname