hostname

[root@RAID ~]# hostname 
RAID
[root@RAID ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
RAID

[root@RAID ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=RAID

[root@RAID ~]# nano /etc/hosts

[root@RAID ~]# nano /etc/sysconfig/network

[root@RAID ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
yumserver

[root@RAID ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=yumserver

[root@RAID ~]# hostname
yumserver

[root@RAID ~]# reboot

Broadcast message from root@yumserver
(/dev/pts/0) at 23:00 …

The system is going down for reboot NOW!
[root@RAID ~]# Connection to 172.16.28.170 closed by remote host.
Connection to 172.16.28.170 closed.

mohammedrafi@NOC-RAFI:~$ ssh root@172.16.28.170
root@172.16.28.170’s password:
Last login: Sat Mar 26 22:56:26 2016 from 172.16.28.1

[root@yumserver ~]# hostname
yumserver

============================================
IF u want to set host name in release-7 use

hostnamectl set-hostname rafi.admin.com

No need for reboot

just use crtl+d(logout) session and login again u can see the changes

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s