LINUX_CENTOS7 Configuring host Names

Source: Internet
Author: User

Original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the following sources, otherwise, the legal responsibility to pursue copyright.

Deep Blue Blog:http://blog.csdn.net/huangyanlong/article/details/45476569

Mode one: Temporarily modify the host name
Grammar:
#hostname < host name >
Cases:

[Email protected]/]# hostname hyltest[[email protected]/]# su-last Login:sun May  

Mode two: command to modify host name
Grammar:
#hostnamectl Set-hostname < host name >

View Hostnamectl Command Help
[Email protected] ~]# Hostnamectl-help
Hostnamectl [OPTIONS ...] COMMAND ...

Query or change system hostname.

 -H--help               Show This help
    --version            Show Package version
    --transient          only set transient hostname
    --static             only set static hostname
    -- pretty            only set pretty hostname
 -P-- privileged        acquire privileges before execution
     --no-ask-password   do and prompt for password
 -h--host=[[email protected]]host  Operate on remote host

Commands:
Status Show current hostname settings
Set-hostname NAME Set System hostname
Set-icon-name name Set icon name for host
Set-chassis NAME Set chassis type for host

Cases:

[Email protected] ~]# hostnamectl set-hostname hyldb[[email protected] ~]# su-last Login:sun May  

Mode three: Configuration file manually modify the host name
Grammar:
Modifying the hostname configuration file
Cases:

[[email protected] ~]# Cd/etc[[email protected] etc]# VI hostnamehyldb~[[email protected] etc]# su-last Login:sun May  

Summary:

Hostnamectl-help

/etc/hostname

Original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the following sources, otherwise, the legal responsibility to pursue copyright.

Deep Blue Blog:http://blog.csdn.net/huangyanlong/article/details/45476569

LINUX_CENTOS7 Configuring host 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.