Linux RHEL – Change hostname

3 step for change hostname to RHEL Linux:

1. edit: /etc/hosts
127.0.0.1 srv03.mil1.wide-net.org localhost.localdomain localhost

2. edit: /etc/sysconfig/network
HOSTNAME=srv03.mil11.wide-net.org

3. past into kernel new hostname
echo "srv03.mil1.wide-net.org" > /proc/sys/kernel/hostname

Or

sysctl kernel.hostname=srv03.mil1.wide-net.org

Consider a restart net services /etc/init.d/network restart but is not strictly required.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.