婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > CentOS7的hostnamectl命令使用詳解

CentOS7的hostnamectl命令使用詳解

熱門標(biāo)簽:ai人工電話機(jī)器人 京東外呼系統(tǒng)怎么操作 bs外呼系統(tǒng) 長(zhǎng)沙人工外呼系統(tǒng)公司 常州云呼叫外呼系統(tǒng) 上海營(yíng)銷外呼系統(tǒng)定制 阿克蘇市地圖標(biāo)注app 河北機(jī)器人電銷 小藍(lán)鴿電話機(jī)器人

centos7 上在主機(jī)名變更新增了一個(gè)hostnamectl 指令 ,該指令的無(wú)論在輸出和更改上都較之前更加的便利。先看下hostname的help幫助信息:

復(fù)制代碼
代碼如下:

[root@361way ~]# 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 not prompt for password
-H --host=[USER@]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

查看hostname信息

復(fù)制代碼
代碼如下:

[root@361way ~]# hostnamectl
Static hostname: 361way
Icon name: computer-desktop
Chassis: desktop
Machine ID: 6917731f5fe447d0bca296ed2802e250
Boot ID: e0d20bc2a3a4474c960394967d33ab53
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-123.6.3.el7.x86_64
Architecture: x86_64

設(shè)置主機(jī)名

從上面的help 幫助里可以看到,在設(shè)置主機(jī)名時(shí),這里涉及到四種主機(jī)名,在hostnamectl 的man手冊(cè)里給予了說(shuō)明和解釋,如下:

This tool distinguishes three different hostnames: the high-level "pretty" hostname which might include all kinds of special characters (e.g. "Lennart's
Laptop"), the static hostname which is used to initialize the kernel hostname at boot (e.g. "lennarts-laptop"), and the transient hostname which might be
assigned temporarily due to network configuration and might revert back to the static hostname if network connectivity is lost and is only temporarily
written to the kernel hostname (e.g. "dhcp-47-11").
Note that the pretty hostname has little restrictions on the characters used, while the static and transient hostnames are limited to the usually accepted
characters of Internet domain names.
更改主機(jī)名

一般情況下都是使用set-hostname進(jìn)行更改:

復(fù)制代碼
代碼如下:

[root@361way ~]# hostnamectl set-hostname blog

更改主機(jī)名一般會(huì)涉及到/etc/hostname 、/etc/machine-info 兩個(gè)文件,同時(shí)對(duì)于不同的名字修改在man手冊(cè)上也給了說(shuō)明:

The static hostname is stored in /etc/hostname, see hostname(5) for more information. The pretty hostname, chassis type, and icon name are stored in /etc/machine-info, see machine-id(5).
set-icon-name 設(shè)置的主機(jī)一般和圖形界面會(huì)用到,對(duì)應(yīng)的hostnamectl 輸出中的Icon name  ,set-chassis 指定了主機(jī)的平臺(tái)類型,如本機(jī)的是desktop,還可以設(shè)置為:"desktop", "laptop", "server", "tablet", "handset"

標(biāo)簽:泉州 忻州 甘孜 來(lái)賓 邢臺(tái) 甘南 銅仁 周口

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《CentOS7的hostnamectl命令使用詳解》,本文關(guān)鍵詞  CentOS7,的,hostnamectl,命令,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《CentOS7的hostnamectl命令使用詳解》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于CentOS7的hostnamectl命令使用詳解的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 佛山市| 晋城| 涟源市| 抚顺市| 延边| 五原县| 六安市| 怀化市| 仙游县| 旺苍县| 田东县| 庄浪县| 申扎县| 六枝特区| 黔西| 错那县| 宁武县| 简阳市| 卓资县| 嵊泗县| 南华县| 洞头县| 都昌县| 永善县| 石嘴山市| 南陵县| 海淀区| 兴义市| 陵水| 马龙县| 黄龙县| 舞钢市| 博罗县| 金山区| 津南区| 嘉祥县| 绥宁县| 达州市| 科技| 怀化市| 镇远县|