Namran Hussin Linux hostname change..

hostname change..

and the next thing is the hostname.

Permanent hostname change on RedHat based systems

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”

So in order to preserve your change on system reboot edit this file and enter the appropriate name using the HOSTNAME variable. Use sysctl to change the hostname

Why would someone need a different method of doing the same thing as above? No idea, but here is anyway: use sysctl to change the variable kernel.hostname: Use:

sysctl kernel.hostname

to read the current hostname, and

sysctl kernel.hostname=NEW_HOSTNAME

to change it.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Installing java plugins for x86_64 CentOSInstalling java plugins for x86_64 CentOS

download the latest from java website : http://download.oracle.com/auth/otn-pub/java/jdk/6u27-b07/jdk-6u27-linux-x64-rpm.bin?e=1313557110&h=84d2a6dfdee93e926d179d506fafa3e3 sh jdk-6u27-linux-x64-rpm.bin ln -s /usr/java/jdk1.6.0_27/jre/lib/amd64/libnpjp2.so /usr/lib64/mozilla/plugins/libnpjp2.so test by : about:plugins Related posts: Firefox 3.6.13 and JRE plugins in CentOS 5.5 Java 1.6