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.
- Using the
hostnamectlcommand:
sudo hostnamectl set-hostname new_hostname- Editing the
/etc/hostnamefile:
sudo nano /etc/hostnamechange the hostname to your desired hostnamern
- save the file and exit
- update the hostname in /etc/hosts file
sudo nano /etc/hostsChange the hostname on the line that starts with 127.0.0.1 or ::1 to your desired hostnamern
- save the file and exit
- Finally, reboot your system for the changes to take effect.
