Re: [Exim] remote host address is the local host

Top Page
Delete this message
Reply to this message
Author: Tim Jackson
Date:  
To: exim-users
Subject: Re: [Exim] remote host address is the local host
Hi Asbjorn, on Wed, 08 Oct 2003 09:09:40 +0200 you wrote:

> I get the message "remote host address is the local host" in
> "exim_errorlog":


Well, basically it's saying "I routed this message, and the end result was
that it needs to be sent to me, but I don't know what to do with it other
than route it back to myself, so there is a loop".

> kjeller.aarrestad.com is added to "relay_to_domains", but this did not
> help


No, because the problem remains that Exim doesn't know what to do with
mail for that domain. Adding it to relay_to_domains just means that people
can send mail to <whatever>@kjeller.aarrestad.com.nospam and it will be
accepted and subsequently routed, but the problem here is that routing for
kjeller.aarrestad.com points to the local host (probably due to a lack of
any Exim routing or MX records to the contrary, so kjeller.aarrestad.com's
name resolution to the local machine is used as a fallback). Setting
relay_to_domains would only help if you had MX records for
kjeller.aarrestad.com pointing somewhere else, but in that case you
probably wouldn't have had this error in the first place.

The problem has arisen because your Exim primary_hostname is not set to
the name you are clearly using for your machine. Let's review your system,
DNS and Exim settings (I found primary_hostname by telnetting to your
machine, and inferred your system hostname from your message):

your system hostname  =   kjeller.aarrestad.com
kjeller.aarrestad.com A   81.29.33.68
81.29.33.68           PTR www.aarrestad.com.
www.aarrestad.com     A   81.29.33.68
primary_hostname      =   aarrestad.com
aarrestad.com         A   <nothing>
aarrestad.com         MX  www.aarrestad.com.
(ignoring the other aarrestad.com MX)


Now, these are a little messed up, because of three problems of varying
severity:

a) your primary_hostname doesn't exist
b) your primary_hostname is not the same as your system hostname
c) forward and reverse DNS is not quite consistent

The issue causing your problem is b) - the difference to your system
hostname. However, note that some destinations will probably refuse your
mail because of problem a) - because your primary_hostname is used in
HELOs when you send out mail, and even without a hardcore Greg Woods-style
DNS consistency check (i.e. checking for problem c), it's clear that the
hostname aarrestad.com doesn't even exist.

Exim, by default, includes the primary_hostname in local_domains, which is
what you need to solve this problem. So the best way to solve this is to
set your primary_hostname correctly in the Exim config, i.e.:

primary_hostname = kjeller.aarrestad.com

and you should be up and running, assuming you still have '@' in
local_domains. (in fact, if you just leave the primary_hostname line
commented out, it normally picks up the correct system hostname).

However, note also that although it will have minimal impact on whether
you can send mail or not (apart from to weird.com and other domains that
require strict DNS consistency) your DNS could perhaps benefit from a bit
of tidying to make more logical sense (and solve problem c), so the end
result would be something like this:

your system hostname  =     kjeller.aarrestad.com
kjeller.aarrestad.com A     81.29.33.68
81.29.33.68           PTR   kjeller.aarrestad.com.
www.aarrestad.com     CNAME kjeller.aarrestad.com.
primary_hostname      =     kjeller.aarrestad.com
aarrestad.com         MX    kjeller.aarrestad.com.
(ignoring the other aarrestad.com MX)


Aside from anything else (and I'm not getting into a long discussion about
forward/rev DNS consistency; there was a very long thread on this list a
few months ago about that), the configuration above will help to clear
your thoughts and simplify things: you have ONE primary hostname which is
used for everything (system hostname, Exim primary_hostname, DNS forward A
and reverse PTR) and then anything else (e.g. www.yoursite) just
references that (via DNS CNAME/MX).

(before anyone starts analysing my DNS: yes, I know I'm missing a couple
of additional PTRs at the moment, strictly speaking).


Hope that helps!


Tim