How to Set or Change Hostname on Fedora 39

To change the hostname on Fedora 39, follow these steps.

Step 1 : Check the current hostname using the following command:

Step 2 : Set the new hostname using the following command:

Step 3 : Verify the change by checking the contents of the hostname file:

Step 4 : Open the hosts file to update the new hostname:

Inside the file, locate the line that starts with 127.0.0.1 and update it with the new hostname. For example:

Step 5 : Reboot your system for the changes to take effect:

Congratulations! You have successfully set or changed the hostname on your Fedora 39 system.