Linux view and modify machine names

Source: Internet
Author: User

Often need to replicate VMs in VMware, for the new machine to be copied to modify the machine name, or in the same LAN conflict, the following is the Linux system to view and modify the machine name method and steps:

1. Check the machine name of the system:

Log in with the root user and enter in the terminal console: hostname

[Email protected]]# hostname

Aaaaaname

2, temporarily modify the machine name:

[Email protected]]# hostname yourname

[Email protected]]# hostname

Yourname

Note: However, the 2nd step of the modification can only be temporary effective, the machine restarted and restored, want to make the modification permanent effect, but also continue the following steps:

3. Modify the Hosts file (path:/etc/hosts):

[Email protected]]# vi/etc/hosts

Change all the original names in the hosts to the name you want to change.

4. Modify the Network file (path:/etc/sysconfig/network):

[Email protected]]# vi/etc/sysconfig/network

Change the hostname=xxx in XXX to the name you want to change.

5. Restart the machine:

[email protected]]# reboot

OK, the modification is complete ~~~~~~~~

This article is from the "Qytag (upspringing)" blog, so be sure to keep this source http://qytag.blog.51cto.com/6125308/1579146

Linux view and modify machine names

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.