...
If running or using any of avahi, CUPS, ejabberd, Exim, /etc/motd, OpenSSH server, ssmtp or sysklogd then read the Debian WIKI page on changing hostname
Ubuntu
...
- edit /etc/hostname
- edit /etc/hosts
service hostname restart
In case you are running ltsp
- change the domain name in /etc/ltsp/dhcp.conf
Not tested (may all be done by the command commands above): if running or using any of avahi, CUPS, ejabberd, Exim, /etc/motd, OpenSSH server, ssmtp or sysklogd then read the Debian WIKI page on changing hostname.
...