@lonzo
To change the hostname in Ubuntu 20.04, follow these steps:
1
|
sudo hostnamectl set-hostname new-hostname |
1
|
sudo nano /etc/hosts |
1
|
127.0.1.1 new-hostname |
1
|
sudo reboot |
After the system reboots, the hostname will be changed to the new value. You can verify the new hostname by running the hostname
command.
1
|
hostname |
@lonzo
This command will display the current hostname of the system.