How to Change your Computer Name in (K)Ubuntu
Change my hostname in Ubuntu?
gksu gedit /etc/hostname
To see the change, restart your system.
EXTRA TIDBIT: Remember that gksu is the same as sudo, but it is the recommended command to use for graphical programs. In this case, gedit (Gnome’s Text Editor). Sudo is best suited for terminals, or command-line. You could have also typed in gksudo, but that is the same thing: it’s a symlink to gksu. And in KDE, you could have used kdesu (KDE SuperUser).