Use of the Linux system command--hostnamectl

Source: Internet
Author: User
Hostnamectl-h

-H--help Display Help
--version Displays the version of the installation package
--transient Modifying the temporary host name
--static Modifying a static host name
--pretty Modifying a flexible host name
-P--privileged privileges obtained prior to execution
--no-ask-password Enter password without prompting
-H--host=[[email protected]]host Operation remote Host

Commands:
Status displays the current hostname settings
Set-hostname Name set the system host name
Set-icon-name Name set icon name for host
Set-chassis Name setting host platform type name

在CentOS7中有三种定义的主机名:

quiescent (static), transient (transient), and flexible (pretty).
The static hostname, also known as the kernel hostname, is the hostname that the system automatically initializes from within/etc/hostname at startup.
A transient hostname is a host name that is temporarily assigned when the system is running.
A flexible hostname allows the use of a host name with special characters.

For example:
View status: Hostnamectl or Hostnamectl status

Modify host Name: Hostnamectl set-name k8s-m2

Use of the Linux system command--hostnamectl

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.