How to Change Hostname Permanently in Ubuntu 22.04

preview_player
Показать описание
How to Change Hostname Permanently in Ubuntu 22.04

Open Terminal

you can see the current host name by using hostname command

you can see our static host name is srv1 by using command is
hostnamectl

if you want to change the host name permanently
sudo hostnamectl set-hostname typenewhostname like ubuntu1
then type the user password
Рекомендации по теме
Комментарии
Автор

worked for me, even after restart the changed hostname is retained. thanks

kartikpodugu
Автор

But after reboot, the hostname would be reset to default.

chenyu
Автор

Tried this (using hostnamectl) on Ubuntu Server 22.04.01, but the hostname was reset to the original hostname after reboot.

bobwatkins