CentOS 7 中使用hostnamectl设置主机名

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 not 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

不想翻译了- -我自己看的话能看懂。

一般使用

hostnamectl set-hostname XXX

来设定主机名。

曉 龍之介

曉 龍之介

无聊。

You may also like...