Difference between revisions of "Hostnamectl"
Jump to navigation
Jump to search
(23 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{lowercase}} |
+ | <code>hostnameclt</code> command included in the <code>[[systemd]]</code> package. | ||
− | + | hostnameclt | |
+ | hostnameclt | grep "[[Operating System]]" | ||
− | <code>/etc/cloud/ | + | == Examples == |
+ | * Set hostname: | ||
+ | ** <code>hostnamectl set-hostname NEW_SERVER_NAME.YOUR_DOMAIN.COM</code> | ||
+ | |||
+ | * 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 | ||
+ | |||
+ | <code>[[/etc/cloud/cloud.cfg]]</code> | ||
preserve_hostname=true | preserve_hostname=true | ||
− | == Related | + | == Related terms == |
* <code>[[virt-clone]]</code> | * <code>[[virt-clone]]</code> | ||
− | + | * <code>[[net-hostname (virt-sysprep)]]</code> | |
+ | * <code>[[hostname]]</code>: <code>[[/etc/hostname]]</code> | ||
+ | * <code>/etc/[[hosts]]</code> | ||
+ | * <code>[[host]]</code> | ||
+ | * <code>[[Terraform provisioner: remote-exec]]</code> | ||
+ | * <code>[[lsb_release]]</code> | ||
== See also == | == See also == | ||
− | * {{ | + | * {{hostnameclt}} |
− | + | * {{FQDN}} | |
− | |||
[[Category:Systemd]] | [[Category:Systemd]] |
Latest revision as of 10:25, 20 March 2024
hostnameclt
command included in the systemd
package.
hostnameclt hostnameclt | grep "Operating System"
Examples[edit]
- 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[edit]
virt-clone
net-hostname (virt-sysprep)
hostname
:/etc/hostname
/etc/hosts
host
Terraform provisioner: remote-exec
lsb_release
See also[edit]
Advertising: