[HOW TO] change hostname in Fedora 21

Today is a better day and you want to change hostname.

But ... how to change?

Okie, let's follow!

In this article, we use the hostnamectl command to change.

1. Get the now information
[root@localhost itien]# hostnamectl
   Static hostname: localhost.localdomain
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: 7432f328ffd84358a2400130ef7bb0ec
           Boot ID: c4c08e6c2eaa4e1a9a7279285ab12502
  Operating System: Fedora 21 (Twenty One)
       CPE OS Name: cpe:/o:fedoraproject:fedora:21
            Kernel: Linux 3.17.8-300.fc21.x86_64
      Architecture: x86-64


2. Change hostname as you want.
[root@localhost itien]# hostnamectl set-hostname --pretty 201407MON0042
[root@localhost itien]# hostnamectl set-hostname --transient 201407MON0042
[root@localhost itien]# hostnamectl set-hostname --static 201407MON0042


3. Re-check hostname
[root@localhost itien]# hostname
201407MON0042


-
Tien

0 nhận xét:

Post a Comment