The simpliest way is to edit
/etc/rc.d/rc.sysinit (as root)
this is the part regarding hostname on my box after I've changed hostname
37 "if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
In the original file created by your distro you should see "HOSTNAME=localhost"
instead of localhost type the name you want to give to your box save the file and that did the trick!
If this will be helpful for you pls spend a second to click thanks button.