Shows you how to change hostname, domain or FQDN permanently.
If you prefer written instructions, please head over to http://soltveit.org/?p=4
Taken from the article linked above. But please go to the article for a more precise description, as youtube doesn't allow certain characters.
Setting the hostname with the hostname command will reset after a reboot. To make it permanently.
To check the hostname, just do:
Hostname
root@mail:~# hostname
mail
Domain Name
root@mail:~# hostname -d
example.com
FQDN (Fully Qualified Domain Name)
root@mail:~# hostname -f
mail.example.com
Open the /etc/hostname to change the hostname.
Open the /etc/hosts to change the Domain name and FQDN.
127.0.0.1 localhost
127.0.1.1 mail.example.com mail
Change the Domain and FQDN in the second line in the hosts file.
Apply with /etc/init.d/hostname.sh start