First open the /etc/hosts file
vim /etc/hosts
Then add the rules we need to set in the /etc/hosts file, for example:
After the modification is completed, restart the network to take effect
/etc/init.d/network restart
Recommended tutorial: centos tutorial
The above is the detailed content of How to modify hosts under centos. For more information, please follow other related articles on the PHP Chinese website!