Change Hostname on Fedora 35 - Step by step guide ?

Fedora

 

A hostname is a human-readable string that helps people refer to a computer by a familiar name. As a system administrator, it is imperative to have a short but recognizable hostname to separate the server machines from each other. Often, a hostname is set during the installation process, but there are times when it needs to be changed.

Here at Fixwebnode, as part of our Server Management Services, we regularly help our Customers to perform related Fedora system configuration queries.

In this context, we shall look into how to Change the Hostname on Fedora 35.

 

Steps to Change Hostname on Fedora 35

1. Perform System Update

To begin, update your Fedora operating system to make sure all existing packages are up to date. Use this command to update the server packages:

$ sudo dnf upgrade
$ sudo dnf update

 

2. Show the Current Hostname

You can check the current hostname by using either the hostname or hostnamectl command:

$ hostnamectl

The output will look like below which shows the static and transient hostnames:

Static hostname: localhost.localdomain
Transient hostname: fedora
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: 65fc9e69d00701bmwe46f31bc527888ed1
           Boot ID: 81ac938872bae0bmwe46cb288841ac93
  Operating System: Fedora 35 (Workstation Edition)
       CPE OS Name: cpe:/o:fedoraproject:fedora:35
            Kernel: Linux 5.15.10-200.fc33.x86_64
      Architecture: x86-64

To see the current static, transient, or pretty hostname, you can use the hostnamectl command with options, such as:

$ hostnamectl --static
$ hostnamectl --transient
$ hostnamectl --pretty

 

3. Change Hostname on the system

You can change the hostname of the Fedora system using the following command. For example, you need to set the computer hostname to fedora.fixwebnode.com:

$ sudo hostnamectl set-hostname fedora.fixwebnode.com

 

4. Confirm the Hostname change

Once changing the Hostname, verify it by typing the hostnamectl command. The result shows the system information along with a new static hostname:

$ hostnamectl

The output will look like this:

Static hostname: fedora.fixwebnode.com
Transient hostname: fedora
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: 65fc9e69d00701bmwe46f31bc527888ed1
           Boot ID: 81ac938872bae0bmwe46cb288841ac93
  Operating System: Fedora 35 (Workstation Edition)
       CPE OS Name: cpe:/o:fedoraproject:fedora:35
            Kernel: Linux 5.15.10-200.fc33.x86_64
      Architecture: x86-64

 

[Need to fix Fedora system issues ? We can help you. ]

 


Conclusion

 

This article covers how to change and set the hostname on your Fedora 35 system. In fact, You can use the hostnamectl command to display or set the Fe

Your Cart