Pages

Saturday, March 10, 2018

Change hostname on Linux Mint

Change hostname on Linux 


To see current hostname settings, type 

hostnamectl

Change hostname using hostnamectl command 

hostnamectl set-hostname <newhostname>

hostnamectl set-hostname homelab1





Another method is to replace old hostname with new hostname in files /etc/hostname and /etc/hosts then reboot the machine.

sudo nano /etc/hostname
sudo nano /etc/hosts
sudo reboot


Reference:
Manpage hostnamectl