How to change hostname on Ubuntu 20.04 LTS

Quý PV
8 tháng trước
1 phút đọc

How to change hostname permanently when using Ubuntu 20.04 LTS server

How to display the current Ubuntu hostname

Run the following command

hostnamectl

Ubuntu 20.04 LTS change hostname permanently

The procedure to change the computer name on Ubuntu 20.04 LTS:

Type the hostnamectl command:

sudo hostnamectl set-hostname dreamtab-server

Next Edit the /etc/hosts file:

sudo nano /etc/hosts

Reboot the system to changes take effect:

sudo reboot