View the machine name: uname-A modify the machine name: RedHat the first step to modify the Host Name:
# Hostname oratest
Step 2:
Modify the hostname in/etc/sysconfig/Network
Step 3:
Modify the/etc/hosts file
SuSE Linux: Modify the/etc/hostname file and save the host name in this file, for example:
Homer100 then run the command to set the Host Name
#/Etc/rc. d/boot. localnet start
Reprinted from: http://blog.csdn.net/wyzxg/article/details/1840110
In Linux, you can use the hostname command to temporarily modify the host name. However, after the host is restarted, the original value is restored.
# Hostname // view the machine name
# Hostname-I // view the IP address corresponding to the machine name
Another method is to modify the configuration file/etc/sysconfig/network for a long time before the system is effective.
The/etc/hosts hostname command reads this configuration file. many friends on the Internet say that you can directly modify the/etc/hosts file, but the host name used by the system will not change, so I think
/Etc/hosts is used in the network, and/etc/sysconfig/network is used in the local machine, and the meridian test is also like this. My version is Linux as3 Summary: So you need to modify the Host Name, change both files.