Best Way to Change Hostname in Linux

Are you tired of root@localhost this hostname??
Best way to change hostname on Linux system:

1. more /etc/sysconfig/network file. You will see entry stating something like HOSTNAME=localhost.localdomain.

2. Edit that entry & modify it to something like HOSTNAME="your preferred name".

3. To activate it instantly do service network restart. Open a new Terminal window, to test the changes.

4. To add this entry permanently do sysctl kernel.hostname="your preferred name". And you are done... ;)