Go to the first, previous, next, last section, table of contents.


The lookuphost router

The `lookuphost' router looks up the hosts that handle mail for the given domain either via the `gethostbyname()' function, or by using the DNS directly. A transport must always be set for this router, unless `verify_only' is set.

When the DNS is used, MX records are looked up first, followed by A records if no MX records are found, unless the domain matches `mx_domains'. Unless they have the highest priority (lowest MX value), MX records that point to the local host, or to any host name that matches `hosts_treat_as_local', are discarded, together with any other MX records of equal or lower priority.

If the host pointed to by the highest priority MX record or the host looked up by `gethostbyname()' is the local host, or matches `hosts_treat_as_local', then what happens is controlled by the generic `self' option.

check_secondary_mx (lookuphost) option

Option: check_secondary_mx
Type: boolean
Default: false

If this option is set, the router fails unless the local host is found in (and removed from) the list of hosts obtained by MX lookup. This can be used to process domains for which the local host is a secondary mail exchanger differently to other domains.

gethostbyname (lookuphost) option

Option: gethostbyname
Type: boolean
Default: false

If this is true, the `gethostbyname()' function is used and the options relating to the DNS are ignored. Otherwise, the name is looked up directly in the DNS. Of course, `gethostbyname()' may do its own DNS lookup for an A record (no MX processing is involved), but it may also access other sources of information such as `/etc/hosts'.

When Exim is compiled with IPv6 support, if a host that is looked up in the DNS has both A and AAAA records, all the addresses are used. See `README.IPV6' for general information about IPv6 support.

mx_domains (lookuphost) option

Option: mx_domains
Type: domain-list
Default: unset

This option applies to domains that are looked up directly in the DNS (`gethostbyname' is not set) for non-source-routed RFC 822 addresses (that is, addresses that do not start with @). A domain which matches `mx_domains' is required to have an MX record in order to be recognised. For example, if all the mail hosts in `fict.book' are known to have MX records, except for those in `discworld.fict.book', options of the form


mx_domains = ! *.discworld.fict.book : *.fict.book

could be used. This would cause messages addressed to a machine that matched the option but had only an A record to be bounced immediately instead of sitting on the queue until the delivery timed out. Note, however, that for source-routed RFC 822 addresses (ones that start with @) this restriction does not apply, as the first domain in such an address is a machine name. The `collapse_source_routes' main configuration option provides a way of locking out the use of source routes.

qualify_single (lookuphost) option

Option: qualify_single
Type: boolean
Default: true

If domains are being looked up in the DNS (`gethostbyname' is false), then the resolver option that causes it to qualify single-component names with the default domain (RES_DEFNAMES) is set. For example, on a machine called `dictionary.ref.book', looking up the domain `thesaurus' would cause the name `thesaurus.ref.book' to be looked up internally in the resolver. Exim itself still looks up the single name.

rewrite_headers (lookuphost) option

Option: rewrite_headers
Type: boolean
Default: true

An abbreviated name may be expanded to its full form by both `gethostbyname()' or by DNS lookup, or as a result of the `widen_domains' option. For example, if an address is specified as `dormouse@teaparty', the domain might get expanded to `teaparty.wonderland.fict.book'. If this option is true, then all occurrences of the abbreviated name in the headers of the message are rewritten with the full name. This option should be turned off only when it is known that no message is ever going to be sent outside an environment where the abbreviation makes sense.

When an MX record is looked up in the DNS and matches a wildcard record, nameservers normally return a record containing the name that has been looked up, making it impossible to detect whether a wildcard was present or not. However, some nameservers have recently been seen to return the wildcard entry. If the name returned by a DNS lookup begins with an asterisk, it is not used for header rewriting.

search_parents (lookuphost) option

Option: search_parents
Type: boolean
Default: false

If domains are being looked up in the DNS (`gethostbyname' is false), then the resolver option that causes it to search parent domains (RES_DNSRCH) is set if this option is true. This is different from the `qualify_single' option in that it applies to domains containing dots. For example, on a machine in the `fict.book' domain, when looking up `teaparty.wonderland' initially fails, the resolver automatically tries `teaparty.wonderland.fict.book' if this option is set. The default setting of this option used to be true, but this causes problems in domains that have a wildcard MX record, because any domain that does not have its own MX record then matches the local wildcard. The default was changed to false in Exim 1.80.

widen_domains (lookuphost) option

Option: widen_domains
Type: string-list
Default: unset

If a lookup fails and this option is set, each of its strings in turn is added onto the end of the domain, and the lookup is tried again. For example, if


widen_domains = "fict.book:ref.book"

is set and a lookup of `klingon.dictionary' fails, then `klingon.dictionary.fict.book' is looked up, and if this fails, then `klingon.dictionary.ref.book' is tried. This option applies to lookups using `gethostbyname()' as well as to DNS lookups. Note that when the DNS is being used for lookups, the `qualify_single' and `search_parents' options cause some widening to be undertaken inside the DNS resolver.


Go to the first, previous, next, last section, table of contents.