How to change the hostname on Linux

If we forget to customize the machine name during the installation of the operating system, we can do it later. The easiest method is using the command line.

This instruction is valid for a computer used at home, which is not part of a enterprise network. We use the hostnamectl command:

hostnamectl set-hostname new-name
ls

This name is stored in the /etc/hostname file.

We can simultaneously check the machine name, operating system, kernel version and architecture with this command:

hostnamectl status
ls

 




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Installing Fedora 41 KDE Plasma
  • Installing Fedora 41 Xfce
  • Jekyll on Fedora - Installation and use
  • LAMP on Fedora
  • Creating one or multiple buttons to copy text to the clipboard