Jul 31

Make sure exim4 (and your system) uses the correct hostname

Category: Linux  ,, — Published by goeszen on July 31, 2012 at 12:23 pm

This post is related to the popular question "How to change the hostname on Linux?", as exim pulls the hostname from the "official sources" on debian.

Edit /etc/hostname
and set the short system name there.

Edit /etc/hosts
which contains the localhost entry and the system name entry, in the form
<IP>   <Hostname_FQD version>   <Hostname>
compare this here.

For good measure, edit /etc/mailname
to have it contain the FQD name.

Run the start script that anounced the hostname on system start-up to propagate the hostname around:
/etc/init.d/hostname.sh start

Test that your system identifies itself as set with hostname -f

If exim is running, restart it to make sure it notices the change
/etc/init.d/exim4 restart

Here, there's no need to re-build the exim configuration with update-exim4.conf, as the hostname is not stated in the exim config files, it's always pulled dynamically.

Btw:
FQD or FQDN means fully-qualified-domain-name, and is usually in the form host.example.com

Then...

When you're done configuring the actual system, make sure that your reverse DNS is configured properly.
Run: $ dig  +noall +answer -x <your server's IP address>
This will give you the reverse DNS lookup of your server's IP, or the "PTR record". In my case, the PTR record is set via a system admin panel of my hosting/housing provider. So, go there and make sure it matches what you configured in exim.

More exim4 related posts on goeszen: tag "exim4"

Leave a Reply

=