This command let you change the hostname on the server that the command line remembers, but it does not actively update all programs that are running under the old hostname.
1- Open a SSH session
a) type hotsname (check your hostname)
b) type hostname "new hostname"
(replace new hostname by whatever you want).