Re: [Exim] DNS lookups failing

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Chris Hughes
Date:  
À: exim-users
Sujet: Re: [Exim] DNS lookups failing
On Thu, 11 Sep 2003, Philip Hazel wrote:
> On Wed, 10 Sep 2003, Chris Hughes wrote:


> > I use smtprelayhost rather than smtprelayhost.domain.name so that I can
> > use the same config file in each location and it should resolve the local
> > relay host.
>
> Non-fully qualified names are dangerous if used in DNS lookups, because
> you can never be sure how the resolver is going to treat them.


Well, you can if it's your DNS! ;)

> > The basic DNS lookup fails to find the hostname due to the default
> > res_options defined in dns.c
> >
> > 48: _res.options &= ~(RES_DNSRCH | RES_DEFNAMES);
> >
> > I'm sure there's a valid reason for this, but how do I get around it just
> > for the manualroute router? Neither qualify_single nor search_parents are
> > valid options for that router.
>
> You didn't quote the full code extract, which reads:
>
> _res.options &= ~(RES_DNSRCH | RES_DEFNAMES);
> _res.options |= (qualify_single? RES_DEFNAMES : 0) |
>                 (search_parents? RES_DNSRCH : 0);


Yes, but why does exim remove those (default on both Linux and Solaris)
resolver options - particularly if its going to do a gethostbyname() call
later anyway (I assume the developer assumed gethostbyname() would follow
the default resolver behavior)[1]?

Exim probably shouldn't be mixing gethostbyname() and direct resolver
calls anyway. Solaris seems to do the 'right thing' and keep them
divorced, but you have to cater for Linux too.

> > This resolves ok on Solaris (ie. gethostbyname() doesn't use
> > _res.options), but fails on Linux (ie. gethostbyname() uses _res.options).
>
> That just proves my point about resolvers behaving differently!


> Or, if you must use the DNS, find a way of detecting the .domain.name so
> that you can use a fully-qualified name. For example, if the
> .domain.name is always the same as that of $primary_hostname, you could
> use some string expansion manipulation to extract it.


I must, I must. Is this something that can be done within the exim
configuration?

I can't help but think that this is something that exim should address
itself. Same exim version and same config file behaving differently
depending on the OS its running on - that's not supposed to happen!

ta,

Chris

[1] A lot of assuming. ;)