This page explains how to change a system's hostname (i.e rename a computer/server)

Executive summary: hostname(1) isn't enough.

Rename a computer

Core networking

Application specific

avahi

Avahi is used to publish (announce) local services. If you tweaked /etc/avahi/* you should run:

ssmtp

Ssmtp is a light weight, send-only smtp server.

Adjust /etc/ssmtp/ssmtp.conf (hostname=, etc.). You don't need to restart the service.

Exim

Adjust /etc/exim4/update-exim4.conf.conf (hostname=). You need to restart the service.

Message Of The Day

Adjust /etc/motd. You don't need to restart a service.

Cups

Adjust /etc/printcap . You need to restart the service.

Mailname

Adjust /etc/mailname. You don't need to restart the service.

Openssh server

Adjust /etc/ssh/ssh_host_rsa_key.pub and /etc/ssh/ssh_host_dsa_key.pub (root@hostname at the end). You need to restart the service.

other

Idea of script to help you on

Complexe or unusual ancient hostname


See also