
You can use the following command to perform a hostname change in your SUSE Linux Enterprise Server (SLES).
Use hostnamectl command to determine the current hostname.
# hostnamectl
Static hostname: CURRENT-HOSTNAME
Icon name: computer-vm
Chassis: vm
Machine ID: abcd1234
Boot ID: abcd1234
Virtualization: vmware
Operating System: SUSE Linux Enterprise Server 15 SP4
CPE OS Name: cpe:/o:suse:sles:15:sp4
Kernel: Linux 5.14.21-150400.24.81-default
Architecture: x86-64
Hardware Vendor: VMware, Inc.
Hardware Model: VMware7,1
Use hostnamectl set-hostname YOUR-NEW-HOSTNAME to change to the new hostname
hostnamectl set-hostname YOUR-NEW-HOSTNAME
Reboot your SUSE Linux Enterprise Server (SLES) to apply the changes and you can execute hostnamectl command again to verify the new hostname.