Read more how-tos Ubuntu How to Change Hostname in Ubuntu 22.04 The hostname is changed using the hostnamectl, hostname, and nmtui commands. Moreover, the files “/etc/hostname” and “/etc/machine-info” can also be used.