Monday, 1 May 2023

Permantely change hostname of ubuntu machine

https://www.cyberciti.biz/faq/ubuntu-20-04-lts-change-hostname-permanently/ 


Ubuntu 20.04 LTS change hostname permanently

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

  1. Type the hostnamectl command :
    sudo hostnamectl set-hostname newNameHere
    Delete the old name and setup new name.
  2. Next Edit the /etc/hosts file:
    sudo nano /etc/hosts
    Replace any occurrence of the existing computer name with your new hostname.
  3. Reboot the system to changes take effect:
    sudo reboot

No comments:

Post a Comment