In the Linux system, we can use the "hostname" command to view the host name, using "Hostname-i" to view the corresponding IP address of the machine name. To modify this host name, you need to modify the two configuration files.
First, modify the "/etc/sysconfig/network" file to change the "hostname=******" line to the desired;
The code is as follows |
Copy Code |
Networking=yes Networking_ipv6=yes Hostname=halo gateway=74.117.63.225 Ipv6_autoconf=no |
Then modify the "/etc/hosts" file,
Modified to:
The code is as follows |
Copy Code |
127.0.0.1 localhost.localdomain localhost 74.117.63.238 Halo |
Complete:
First step:
The code is as follows |
Copy Code |
#hostname Oratest
|
Step Two:
Modify the hostname in/etc/sysconfig/network
Step Three:
modifying/etc/hosts files
another way to do that is to change the configuration file
Modify/etc/sysconfig/network Modify this file, the system is valid
/etc/hosts hostname command to read this configuration file
There are a lot of friends on the Internet that can directly modify the/etc/hosts file, but the system itself used to host the name of the place will not change, so I think
/etc/hosts is used in the network,/etc/sysconfig/network is the local function, and the meridian test is like this, I have the version is
Linux AS3