RHEL 7 How to change the hostname for a server, new commands ?

RHEL 7 introduced some new commands so it wouldn’t be like the older versions if you have to change the hostname, looking for commands to change the hostname, check this out :

 

hostname
nirvana

A static hostname file exists with entry of hostname under /etc/hostname, you can use command line option to change the hostname :

 

[root@nirvana ~]# hostnamectl set-hostname ciscomaster.mozilla.org
[root@nirvana ~]# hostname
ciscomaster.mozilla.org

Advertisements

RHEL 7 How to check ip address for network card


[root@nirvana ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:56:17:d9 brd ff:ff:ff:ff:ff:ff
inet 192.168.195.135/24 brd 192.168.195.255 scope global dynamic eth0
valid_lft 1176sec preferred_lft 1176sec
inet6 fe80::20c:29ff:fe56:17d9/64 scope link
valid_lft forever preferred_lft forever