My Hostname is not getting updated in RHEL VM using CentOS

I have created a RHEL VM with CentOS7.

I tried to change the Hostname in "/etc/hosts" file.

Eventhough I have updated the localhost name as expected(10.x.x.xx), my Terminal still shows as ["username@10 ~]$

Upvotes: 0

Views: 309

Answers (1)

NullDev
NullDev

Reputation: 7303

Try to update /etc/hostname aswell.

If that doesn't work, use hostnamectl set-hostname NEWNAME

Then restart the service with systemctl restart systemd-hostnamed

Upvotes: 1

Related Questions