How to change the host name in linux

Source: Internet
Author: User
In linux, how does one modify the linux host name to take effect? Many people use the hostname to modify the host name. In fact, this is only for the moment. after restarting, it will be restored to the original name. many people say that to modify the/etc/hosts file, the host name in this file is only provided to d... in linux, how does one modify the linux host name to take effect? Many people use the hostname to modify the host name. In fact, this is only for the moment. after restarting, it will be restored to the original name. many people say that the host name in the/etc/hosts file is only provided for dns resolution. if you cannot use dns, you only need to modify the host name. in fact, it is to modify the host name in the file etc/sysconfig/network. NETWORKING = yes HOSTNAME = host name ------------------------------------------------------------------------ remember to restart !!! Complete hosts: Step 1: # hostname oratest Step 2: modify hostname in/etc/sysconfig/network Step 3: modify the/etc/hosts file note: Linux host names can include: uppercase/lowercase letters, numbers, and hyphens (-) Note: but it cannot contain underscores or begin with a number. For example, if the host name is incorrect for 51cloud or cloud_redhat64_vm. The host name should not be in this structure: the host name such as fenghao.cn is also faulty. A standard host name is the basis for your management system and server setup. If your host name is invalid, you may encounter an inexplicable error. for example, an application cannot connect or communicate with another host name based on the specification when running the program !!!
Related Article

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.