Home Change Hostname On Ubuntu Linux CLI
Post
Cancel

Change Hostname On Ubuntu Linux CLI

Change Hostname On Ubuntu Linux CLI

To view the current hostname setup

1
hostnamectl

Run command to change the hostname

1
sudo hostnamectl set-hostname <NEW_HOSTNAME_HERE>

Edit the /etc/hosts file and update any localhost entries

1
sudo nano /etc/hosts

Reboot the host

1
sudo reboot
This post is licensed under CC BY 4.0 by the author.