Go ahead and do it then. It'll probably work fine
When I changed one of my hostnames, and I think I tried it with the
hostname .... command rather than by editing the
/etc/hostname file, it went badly wrong when I rebooted. I could not login as myself, or root. Not even in "System Rescue" mode. I needed a live CD to sort it out. Probably I was just stupid and made an elementary mistake. Maybe I have the error (and solution) logged somewhere, but Errr, on which PC? Nag me and I'll probably find it if necessary
My recollection is that it is best to change the hostname in
/etc/hostname, and then reboot
immediately. Linux (unlike windows) rarely needs a reboot, but the hostname is so vital to so many processes that it is necessary to restart most of them. The fastest and easiest way to do this is to reboot.
Do not alter the
localhost address at
127.0.0.1 referenced in
/etc/hosts. This is the "loopback" interface that many programs reference to access "the piece of hardware that I am currently running on". For example, I can access the cups manager by either
http://localhost:631 or by
http://vaio:631 ("vaio" being my laptop's hostname, but other programs / processes will expect to access this interface through the
localhost interface, even though they are pointing at the same machine)
Just have a bootable rescue "live" CD to hand in case all hell lets loose (it probably won't, but you can of course come back here for help and advice if it does!)
Moral of the story: Hostname is pobably best decided at install time - it is of vital importance to many processes.
Let us know how you get on.