Edit /etc/hosts to include a line under the localhost one with a loopback IP and the new hostname, eg
/etc/hosts
localhost
127.0.0.1 localhost 127.0.0.1 newhostname