How change hostname on Fedora 22

May 29, 2015 | By | Reply More

This tutorial is going to show you how to show hostname on Fedora Server 22. Also we will show you how to set the new hostname for Fedora Server 22. We use hostnamectl command to display hostname on Fedora system. 

A. Display your current hostname on Fedora 22

Open Terminal and paste this command

hostnamectl status

It should display something like this

[root@localhost ~]# hostnamectl status

   Static hostname: localhost.localdomain

         Icon name: computer-vm

           Chassis: vm

        Machine ID: 861d4e395c3a4b7aa5ba798d1d67e45c

           Boot ID: 78d377f39ef04ed1a443b42acc46f981

    Virtualization: kvm

  Operating System: Fedora 22 (Twenty Two)

       CPE OS Name: cpe:/o:fedoraproject:fedora:22

            Kernel: Linux 4.0.4-301.fc22.x86_64

 

      Architecture: x86-64

B. Change the hostname

hostnamectl set-hostname –pretty fedora-server
hostnamectl set-hostname –transient fedora-server
hostnamectl set-hostname –static fedora-server

Change fedora-server with your new hostname

Now check with hostnamectl status command

If you still see your old hostname, you should reboot Fedora. Thank you and have a nice day.

Tags: , , , ,

Category: Fedora

Leave a Reply