Pages

Wednesday, November 2, 2011

Changing Linux Host Name permanently


RedHat based system use the file /etc/sysconfig/network to read the saved hostname at system boot. This is set using the init script /etc/rc.d/rc.sysinit
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=”plain.domainname.com”
GATEWAY=”192.168.0.1″
GATEWAYDEV=”eth0″
FORWARD_IPV4=”yes”
Make changes in the /etc/hosts file to make sure that new hostname is getting resolved 
So in order to preserve your change on system reboot edit this file and enter the appropriate name using the HOSTNAME variable.

1 comment:

  1. Thanks for this information and i am going to try this.Website Hosting India

    ReplyDelete