OS:CentOS7
[root@cent1 ~]# hostname ←ホスト名を確認
cent1
[root@cent1 ~]#
[root@cent1 ~]# cat /etc/hostname ←ホスト名が記述されている元ファイル
cent1
[root@cent1 ~]# vi /etc/hostname ←viでホスト名を編集
[root@cent1 ~]# cat /etc/hostname ←ホスト名の変更を確認
cent02
[root@cent1 ~]#
[root@cent1 ~]#
[root@cent1 ~]#reboot ←os再起動
---------------OS_Reboot後---------------
[root@cent02 ~]# hostname ←ホスト名更新を確認
cent02
[root@cent02 ~]#