I'm trying to forward the emails from my Debian server to my usual email address. I'm probably missing something important, as I can't find a good solution online looking for the following error message:

dnslookup defer (-1): host lookup did not complete

I found this answer but it did not help me: https://serverfault.com/questions/370489/exim-cannot-send-to-remote-mail-servers

I have a user Debian-exim:

uid=101(Debian-exim) gid=103(Debian-exim) groups=103(Debian-exim)

I don't think that port 25 is filtered on my network. Anyway, I think that it is a DNS issue for now. I am not sure if the following server here is still working and can't find another address to test with:

telnet 25
telnet: Unable to connect to remote host: Connection timed out

This works:

echo "This is a test." | mail -s Testing user@localhost

This does not:

echo "This is a test." | mail -s Testing [email protected]
echo "This is a test." | mail -s Testing [email protected]

In /var/log/exim4/mainlog I got:

1YDDm0-0007mZ-BS <= [email protected] U=user P=local S=464
1YDDm0-0007mZ-BS == [email protected] R=dnslookup defer (-1): host lookup did not complete
1YDE1X-0007v5-EG <= [email protected] U=user P=local S=456

And in /etc/resolv.conf:

domain home
search home

And finally (The interesting part seems to be at the very end):

sudo exim -bt -d-resolver [email protected]
[sudo] password for user: 
Exim version 4.80 uid=0 gid=0 pid=31872 D=fbb95cfd
Berkeley DB: Berkeley DB 5.1.29: (October 25, 2011)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
Compiler: GCC [4.6.3]
Library version: GnuTLS: Compile: 2.12.20
                         Runtime: 2.12.20
Library version: PCRE: Compile: 8.30
                       Runtime: 8.30 2012-02-04
Total 13 lookups
TRUSTED_CONFIG_LIST: "/etc/exim4/trusted_configs"
changed uid/gid: forcing real = effective
  uid=0 gid=0 pid=31872
  auxiliary group list: <none>
seeking password data for user "uucp": cache not available
getpwnam() succeeded uid=10 gid=10
changed uid/gid: calling tls_validate_require_cipher
  uid=101 gid=103 pid=31873
  auxiliary group list: <none>
tls_validate_require_cipher child 31873 ended: status=0x0
configuration file is /var/lib/exim4/config.autogenerated
log selectors = 00000ffc 00612001
trusted user
admin user
seeking password data for user "mail": cache not available
getpwnam() succeeded uid=8 gid=8
user name "root" extracted from gecos field "root"
originator: uid=0 gid=0 login=root name=root
sender address = [email protected]
Address testing: uid=0 gid=103 euid=0 egid=103
Testing [email protected]
Considering [email protected]
routing [email protected]
--------> hubbed_hosts router <--------
local_part=my domain=mail.eu
checking domains
expansion of "${if exists{/etc/exim4/hubbed_hosts}{partial-lsearch;/etc/exim4/hubbed_hosts}fail}" forced failure: assume not in this list
hubbed_hosts router skipped: domains mismatch
--------> dnslookup_relay_to_domains router <--------
local_part=my domain=mail.eu
checking domains
mail.eu in "@:localhost:example.dynu.com"? no (end of list)
mail.eu in "empty"? no (end of list)
mail.eu in "! +local_domains : +relay_to_domains"? no (end of list)
dnslookup_relay_to_domains router skipped: domains mismatch
--------> dnslookup router <--------
local_part=my domain=mail.eu
checking domains
cached no match for +local_domains
cached lookup data = NULL
mail.eu in "! +local_domains"? yes (end of list)
R: dnslookup for [email protected]
calling dnslookup router
dnslookup router called for [email protected]
  domain = mail.eu
DNS lookup of mail.eu (MX) gave TRY_AGAIN
mail.eu in dns_again_means_nonexist? no (option unset)
returning DNS_AGAIN
dnslookup router: defer for [email protected]
  message: host lookup did not complete
[email protected] cannot be resolved at this time: host lookup did not complete
search_tidyup called
>>>>>>>>>>>>>>>> Exim pid=31872 terminating with rc=1 >>>>>>>>>>>>>>>>

Could someone help me out here?

Thanks a lot!

1 Answer 1


The standard dnslookup router of exim uses an algorithm to decide how to resolve an email address (this is detailed in the Exim manual on the chapter detailing dnslookup router). Looking at the results from dig, this seems fine:

$ dig mail.eu mx

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> mail.eu mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5467
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 4

;mail.eu.           IN  MX

mail.eu.        86400   IN  MX  10 in1-smtp.messagingengine.com.
mail.eu.        86400   IN  MX  20 in2-smtp.messagingengine.com.

in1-smtp.messagingengine.com. 72474 IN  A
in1-smtp.messagingengine.com. 72474 IN  A
in1-smtp.messagingengine.com. 72474 IN  A
in1-smtp.messagingengine.com. 72474 IN  A

;; Query time: 33 msec
;; WHEN: Mon Jan 19 16:51:24 2015
;; MSG SIZE  rcvd: 158

This means that your local resolver ( is either returning a TRY_AGAIN response for the SRV request (have you got SRV enabled in your exim configuration) OR has "negatively cached" a failed result (was your DSL down at the time it happened?).

I would suggest testing around your resolver by using an open DNS server (such as Google's), by adding:


before your


statement in your resolv.conf and then try running you exim -bt [email protected] test again to rule out this resolvers response.

If using Google's DNS cache server solves the issue, then a restart of your DNS resolver (the device at to see if that solves the ongoing issue (don't forget to comment out the Google cache entry before re-testing!)

There are other options detailed in that chapter if you continue to get errors even when using Google's DNS cache servers (or if you prefer NOT to use an external DNS resolver). Note that by adding the nameserver line all DNS lookups will be passed to Google for resolving. This will add a small delay to DNS requests as well as passing on all DNS requests your host will make to Google - not everyone's idea of a "Good Thing"™.

  • Thanks a lot. I tried to use google's DNS and the dnslookup works now! I don't know why I didn't think about that... I still have an issue since I now got "No route to host", "Connection timed out" and "Network is unreachable" errors. The command "telnet 2a00:1450:4010:c05::1b 25" gives me the same errors. I guess port 25 is filtered here then.
    – bg666
    Commented Jan 19, 2015 at 17:30
  • If they do not filter icmp/udp, you can test if port 25 is blocked. Try running a traceroute 2a00:1450:4010:c05::1b. If that shows many hops and reaches the destination, then yes most likely port 25 outbound is blocked.
    – Drav Sloan
    Commented Jan 19, 2015 at 17:33
  • Oh and don't forget to accept the answer if you think this has solved the immediate issue you were facing, thanks! ;)
    – Drav Sloan
    Commented Jan 19, 2015 at 17:36
  • I sent an email to the IT support to make sure. Thanks a lot!
    – bg666
    Commented Jan 19, 2015 at 17:51
  • Wonderful tip the, I've been stuck for a whole day until I tried your tip.
    – Basil A
    Commented Mar 29, 2017 at 17:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .