Change host name

To temporarily change the host name, use command:


To permanently change the hostname, open file /etc/sysconfig/network. Use, for example, vi-editor:

vi /etc/sysconfig/network 

Find and change following line to your host name (and domain)

save file and restart network service

service network restart

This works in CentOS and Red Hat version 6.x. You may also need to change /etc/hosts file.

Leave a Reply