Change a Linux hostname boot persistent

Q: How to change your linux box hostname after you have installed your OS:

A: You can change your hostname temporarily by hostname command.

Getting current hostname:
# hostname

Change it to desired name:
# hostname test2

# hostname

But if it is not boot persistant and after reboot it goes back to previous hostname. To make it boot persistent we need to change it in the network config file: 

# vi /etc/sysconfig/network


And after reboot we have the new hostname permanently. 


Popular posts from this blog

Running Docker Wildfly/JBoss Application Server in Debug mode via Eclipse

Building RPM OpenSSH 7.1p1 on RHEL/CentOS 6.5