How to change hostname in Fedora Linux permanently

To change the hostname in Fedora Linux permanently, you can follow these steps:

  1. Edit the Hostname File: Open the file /etc/hostname in a text editor and replace the current hostname with the desired hostname. Save and close the file.
  2. Edit the Hosts File: Open the file /etc/hosts in a text editor and replace the current hostname with the desired hostname. Save and close the file.
  3. Restart the Hostname Service: Restart the hostname service to apply the changes with the following command:
    sudo systemctl restart systemd-hostnamed
  4. Reboot the System: To make sure the changes take effect, reboot the system with the following command:
    sudo reboot

These are the steps to change the hostname in Fedora Linux permanently. After the reboot, the system should be using the new hostname.

Leave a Comment