Sunday, July 7, 2013

Changing hostname in Fedora > 18

Bofore we use to change the hostname in Fedora by editing /etc/sysconfig/network file, however Fedora 18, 19 have now using hostnamectl command. Hostname is now in /etc/hostname file and not in /etc/sysconfig/network

Current status of the system

[root@slacker ~]# hostnamectl status
Static hostname: slacker
Icon name: computer-vm
Chassis: vm
Machine ID: 9388a5eb453d59f4fd98567b37061720
Boot ID: 0c3a942a81ae44daa748c545aed51c2a
Virtualization: vmware
Operating System: Fedora 19 (Schrödinger’s Cat)
CPE OS Name: cpe:/o:fedoraproject:fedora:19
Kernel: Linux 3.9.9-301.fc19.i686
 Architecture: i686


To change hostname
# hostnamectl set-hostname fedoravm

[root@slacker ~]# hostnamectl status
Static hostname: fedoravm
Icon name: computer-vm
Chassis: vm
Machine ID: 9388a5eb453d59f4fd98567b37061720
Boot ID: 0c3a942a81ae44daa748c545aed51c2a
Virtualization: vmware
Operating System: Fedora 19 (Schrödinger’s Cat)
CPE OS Name: cpe:/o:fedoraproject:fedora:19
Kernel: Linux 3.9.9-301.fc19.i686
Architecture: i686



No comments:

Post a Comment