Issues that happen when you change the hostname and reverse DNS (Part 1)

Sometimes it’s necessary to change the hostname or the reverse DNS of a server. When altering these settings without some care this will result in some issues. This article shows you what you should consider.

In this article we assume the old hostname was and the new will be

Old hostname still in the email header Received

Before we change the hostname and reverse DNS let’s have a look at what information an email client in general sees.

When clicking on an email in Thunderbird you’ll see the actual email text. If you want to see more details just click on Other Actions > View Source.


Now you’ll see something that looks like the following block.

Received: from
    by (Dovecot) with LMTP id mGnEDHVwAIfwNDAOgxpbQ8
    for ; Mon, 25 Mar 2013 10:37:11 +0100
X-policyd-weight: using cached result; rate:hard: -5.5
Received: from ( [])
    by (Postfix) with ESMTP id 9C27E1222FC0
    for ; Mon, 25 Mar 2013 10:37:10 +0100 (CET)
Received: by (Postfix, from userid 0)
    id 8D9F52F9C87D1; Mon, 25 Mar 2013 10:37:09 +0100 (CET)
Subject: Mo oder Mi

At the bottom are the email headers To and Subject and above a couple of Received headers which tell you what path your email exactly took through the internet from the sender to the destination server.

To get the trace you have to follow from the bottom up to the top. This means, start reading with the third Received header in line 9, then read the second in line 6 and finally have a look at the first one in line 2.

Every Received entry contains the hostname of the server which is processing your email. In this case it got firstly processed by and then twice by

Now if you decide to change the hostname in /etc/hostname and also change the reverse DNS you expect to have changed to in the second Received header.

Unfortunately if you only edit /etc/hostname then your old and new hostname will appear both in the Received headers.

Received: from ( [])
    by (Postfix) with ESMTP id 9C27E1222FC0
    for ; Mon, 25 Mar 2013 10:37:10 +0100 (CET)

The reason is that Postfix keeps a variable with your hostname in its configuration file /etc/postfix/ that you forgot to edit. To fix it just open this configuration file and change the line with the variable hostname. Afterwrads you have to restart postfix by executing

/etc/init.d/postfix restart

when using System V scripts or for systemd

systemctl start postfix.service


  1. I am proper now taking a look at methods of making my very own on-line web site web
    site like eBay may should attempt to discover others who would wish to help me, so
    we can cut up the price and the money that it brings
    in from other buyers and sellers.

  2. There is visibly a bundle to identify about this. I believe you made certain good points
    in features also.

  3. How we use GSA online marketing services search engine Ranker – an in-depth look at our
    approaches when it involves employing this powerful link building tool.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>