hostnamectl hostname
hostname : 内核变量位置 /proc/sys/kernel/hostname, 启动时,会从 /etc/hostname读取

man hostname


hostname 可获取 fqdn ip domain 还有 nis 等选项

设置Linux 的domain的方式,在 /etc/hosts中


--boot选项 跟没有一样 只设置了 内核 hostname
hostnamectl:
hostnamectl set-hostname 会同时修改 内核 和 /etc/hostname 的主机名

单独设置 transient hostname 没什么用


设置 pretty-name

pretty-name & icon-name are stored in /etc/machine-info


hostname 会被大写字母转为小写字母而且,会把 pretty name重置

hostname 可接受纯数字 , 满足 domain name规范

icon-name
https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

由 systemd提供
machine id : /etc/machine-id

boot id:

可得到 boot id 从 /proc/sys/kernel/random/boot_id读取, 每次重启都会变化


hostname 并不会与 systemd-hostnamed.service交互
set-location

set-deployment

set-chassis



浙公网安备 33010602011771号