Arch Linux Change Hostname (computer name)

To change the hostname (computer name) on Arch Linux, you can use the hostnamectl command or edit the /etc/hostname file directly.

  1. Using the hostnamectl command:
sudo hostnamectl set-hostname new_hostname
  1. Editing the /etc/hostname file:
sudo nano /etc/hostname

change the hostname to your desired hostname

  1. save the file and exit
  2. update the hostname in /etc/hosts file
sudo nano /etc/hosts

Change the hostname on the line that starts with 127.0.0.1 or ::1 to your desired hostname

  1. save the file and exit
  2. Finally, reboot your system for the changes to take effect.

It’s important to note that changing the hostname will only change the name of your computer, it will not affect the username or home directory. It’s also important to note that the above steps are just a general guide and you may need to adjust them to suit your specific requirements.

Leave a Comment