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 :



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

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 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 brd 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