How to Change Hostname in Ubuntu Server (Step-by-Step

Опубликовано: 21 Май 2026
на канале: LinuxWithPunleur
No
0

In this video, I show how to change the hostname in Ubuntu Server using the hostnamectl command.

Commands used:
sudo hostnamectl set-hostname new-hostname

Then update:
/etc/hosts

This method works on Ubuntu 20.04, 22.04, and 24.04.

Topics covered:

Check current hostname
Change hostname permanently
Update hosts file
Verify changes

If cloud-init resets the hostname after reboot, I also explain how to fix that.

#Ubuntu #Linux #UbuntuServer #Hostname #LinuxAdmin #ServerManagement