How to change a machines hostname in Red Hat 6
There are several ways to change the hostname of a machine running Redhat 6. These also works on CentOS, Fedora and older/other Redhat variants.
First: The "hostname" command.
You can use the hostname command to see the current host name of the system.
# hostname
ebisapps.expolanka.com
You can also use the hostname command to change the host name of the machine.
# hostname ebis.expolanka.com
Then issue the hostname command again to see the changes.
# hostname
ebis.expolanka.com
This only makes a temporary or non-persistent change of hostname.
Second: The /etc/sysconfig/network configuration file. (preferred method)
In order for the change to survive a reboot, or to make it persistent, you must change it in the /etc/sysconfig/network file.
Open the file in your favorite editor and change the following line to reflect your desired hostname.
# vi /etc/sysconfig/network
HOSTNAME=ebis.expolanka.com
After making changing to the configuration file you need to restart the network service in order to read that file.
# /etc/init.d/network restart
NOTE: Do not do this remotely (via ssh) or you will lose your connection.
If you issue the hostname command now, you will see the hostname has changed.
Third: The /proc/sys/kernel/hostname entry.
Another simple way to change the hostname is to echo the hostname into the /proc/sys/kernel/hostname file.
# echo "ebis.expolanka.com" > /proc/sys/kernel/hostname
NOTE: Using the /etc/sysconfig/network file is the preferred method to set the permanent hostname of a system. Anything in the /proc/sys/kernel/hostname file will be overridden by the /etc/sysconfig/network file during a reboot.
If you are using Red Hat 7 (RHEL7), CentOS 7 or newed versions of Fedora click below of instructions on changing your hostname.
http://www.putorius.net/2015/04/how-to-change-system-hostname-in-red.html
This blog contains Oracle Database and RHEL and OEL support and troubleshoot documents. Most of them are copied from Oracle support Documents and references are mentioned.
Saturday, April 15, 2017
Subscribe to:
Post Comments (Atom)
RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time https://shivanandarao-oracle.com/2012/12/05/rman-20207-until-time-or-re...
-
DBCA Fails To Create Oracle 19c Database On AIX [DBT-05509] (Doc ID 2663388.1 ) In this Document ...
-
[oracle@db ~]$ dbca DISPLAY not set. Set DISPLAY environment variable, then re-run. [oracle@db dbhome_1]$ DISPLAY=:1.0 ; export DISPL...
-
Oracle auditing setup & configuration The Oracle audit command is used to to create specific audit trails for Oracle tables. to ena...
No comments:
Post a Comment