Change HostName

Apr 2023

To change the hostname of an Alma Linux instance, use the following procedure.
First, check the current hostname: from the console enter:

hostname
or
hostnamectl

This will give an output similar to below:

Static hostname: localhost.localdomain
Icon name: computer-server
Chassis: server
Machine ID: 87b77afdf05948d88282bb44dc1e8386
Boot ID: a7c17a79aa394c2f84758fa133c735cb
Operating System: AlmaLinux 8.5 (Arctic Sphynx)
CPE OS Name: cpe:/o:almalinux:almalinux:8::baseos
Kernel: Linux 4.18.0-348.el8.x86_64
Architecture: x86-64