Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to send mail from sub.domain.com but delivery to one address fails with an error "R=lookuphost defer (-1): host lookup did not complete".

Additional information that might be relevant: My /etc/resolv.conf contains nameservers of a VPS provider (different from domain provider's nameservers). I also checked DNS records of the addressee and found out there was no MX record for it.

share|improve this question
2  
You should explain what the problem is, not what you think the solution is. –  Michael Hampton Mar 31 at 14:42
    
thank you, I edited my question –  hiirulainen Mar 31 at 16:01
    
1. Just because there is no MX record, it does not mean that mail cannot be sent there an A record is valid in absence of an MX record. 2. Does this VPS provider's DNS do recursive lookups for you? –  NickW Mar 31 at 16:02
    
@NickW I think it does not do recursive lookup. I checked it by "host mysubdomain.domain.com vps_providers_nameserver" and it returned REFUSED; also dig nameserver mysubdomain.domain.com returned "recursion requested but not available" –  hiirulainen Mar 31 at 16:43
    
That's not good, you want to configure a DNS server that will do recursive lookups for you, especially if you want to run a mailserver. –  NickW Mar 31 at 16:49

1 Answer 1

up vote 0 down vote accepted

check if MX DNS resolution fails from your side or not with mxtoolbox.com

  • if you don't have MX results. exim should fallback to A record. cf exim FAQ (check Q0311 too)

use exim -bt -d-resolver user@example.org to diagnose exim mail routing

  • if yes. it means DNS resolution fails on your side.

run nslookup -type=MX example.org on your server. and check if you get MX records answers.

if not, try the same request but specify a well known nameserver, like google public dns: nslookup -type=MX example.org 8.8.8.8

you should now get some MX results, and it means your nameserver is not working properly. So you can change your resolv.conf to a nameserver that works properly (provider, google dns, what you want, ..) or setup your own

share|improve this answer
    
thank you! If I don't get any MX results for subdomain.example.com but get them for example.com, does it count? –  hiirulainen Mar 31 at 17:35
    
Not to my knowledge. the only one fallback is A record –  exeral Mar 31 at 18:18
    
one last question! if exim -bt -d-resolver user@example1.org succeeds but exim -bt -d-resolver user@example2.org fails, doesn't it mean that the problem is with example2.org and not with me? –  hiirulainen Mar 31 at 18:40
    
besides, when I do dig @8.8.8.8 example2.org I get status: SERVFAIL and no answer section. And example2.org is the only domain I'm having such problems with, all my other addressees are able to get emails from me –  hiirulainen Mar 31 at 18:49
    
it means the nameserver of example2.org is unreachable, misconfigured. the problem is not on your side –  exeral Mar 31 at 19:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.