hostnamectl
hostnameclt
command included in the systemd
package.
Examples
- Set hostname:
hostnamectl set-hostname NEW_SERVER_NAME.YOUR_DOMAIN.COM
- Read information:
hostnamectl Static hostname: VM_NAME1 Transient hostname: VM_NAME2 Icon name: computer-vm Chassis: vm Machine ID: 55b9165a7ae241bf9b59adaf1d93a867 Boot ID: t46f00f0acda40a9b2aaecf3fec1b512 Virtualization: vmware Operating System: Ubuntu 20.04.1 LTS Kernel: Linux 5.4.0-53-generic
/etc/cloud/cloud.cfg
preserve_hostname=true
Related terms
virt-clone
net-hostname (virt-sysprep)
hostname
:/etc/hostname
/etc/hosts
host
Terraform provisioner: remote-exec
lsb_release
See also
hostnamectl
,cloud-init
,/etc/cloud/cloud.cfg
- FQDN, DNS,
hostname, dnsdomainname, domainname, hostnamectl, /etc/hostname, /etc/resolv.conf, /etc/systemd/resolved.conf, hostname -f
- Systemd:
systemctl
,systemd-journald
,journalctl
systemd-cat
,systemd-logind
,systemd-networkd
:networkctl
,systemd-timesyncd
,systemd-resolved
,systemd-udevd
[1],Systemd-logind: loginctl
,hostnamectl
,udevadm
,systemd-run
,portablectl
,systemd-nspawn
, systemd resource management, Timer (systemd), systemd logs,/etc/systemd/
, systemd services,systemd-mount
,/run/systemd/
,.service
,/usr/lib/systemd/
,/usr/lib/systemd/system/
,/usr/lib/systemd/system/systemd-resolved.service
,/lib/systemd/
, machinectl, systemd-oomd, systemd-analyze
Advertising: