CentOS host name modification

Source: Internet
Author: User
Quickly modify the host name in SSH. 1. view the current host name. hostname # run this command. check the current host name. 2. modify the host name to www.centoscn.comhostnamewww.centoscn.com. the yellow part can be modified according to your actual situation, press enter to save it. 3. automatically modify the host name at startup. if you have special requirements, use Li to quickly modify the host name in SSH.
1. view the current host name
Hostname # directly execute this command to view the current host name

2. change the host name to www.centoscn.com.
hostname www.centoscn.com

You can modify the yellow part based on your actual situation and press enter to save it.


III. automatically modify the host name upon startup

If you have special requirements, run the command through the Linux boot software.


1. edit related files
vi /etc/rc.d/rc.local

2. add a command line
hostname www.centoscn.com

Enter the above code in another line at the bottom of the file. modify the yellow part by yourself. After the command is saved, the system automatically runs the command at the next boot.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.