Ubuntu Linux Change Hostname (computer name)

Table of Content

Ubuntu Linux Change Hostname

Ubuntu change hostname command

The procedure to change the computer name on Ubuntu Linux:

  1. Type the following command to edit /etc/hostname using nano or vi text editor:

    sudo nano /etc/hostname
    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 one.

  3. Reboot the system to changes take effect:

    sudo reboot

Sample outputs:

ubuntu-change-computer-name-demo-copy

https://www.cyberciti.biz/faq/ubuntu-change-hostname-command/

Leave a Reply

Your email address will not be published.