Linux : Mail issues after renaming server hostname

By | July 26, 2020

If you changed the hostname/FQDN of a Linux server, you may end up with some issues, especially with mailing if some areas were forgotten with that change. Here is a quick procedure involving all the steps you should be looking for. (The following example is based on a Debian Linux system running Postfix MTA.)

1. Update the hostname file :

2. Update the hosts file :

3. Update the mailname file :

4. Update the Postfix file :

myhostname =
mydestination =

5. Update the DNS pointer record (PTR), if you had any : IN PTR your-new-hostname.domain.tld



6. Update the aliases file if you had any added entries with the previous FQDN

6.1. Rebuild the aliases database :