How to change hostname in Fedora Linux permanently

How to change hostname in Fedora Linux permanently

To change the hostname in Fedora Linux permanently, you can use the hostnamectl command with the set-hostname option.

Here's an example of how to use the hostnamectl command to change the hostname in Fedora Linux:

‮t refer‬o:lautturi.com
hostnamectl set-hostname new_hostname

This will set the hostname to new_hostname.

To make the change permanent, you can edit the /etc/hostname file and set the hostname to new_hostname. For example:

echo "new_hostname" > /etc/hostname

You may also need to update the /etc/hosts file to reflect the new hostname. Find the line that contains the old hostname and replace it with the new hostname. For example:

127.0.0.1   localhost localhost.localdomain new_hostname

After making these changes, you will need to reboot the system for the hostname change to take effect.

Created Time:2017-10-28 21:38:58  Author:lautturi