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.

Let's say I've got a wildcard subdomain CNAME for root domain:

*.domain.com CNAME domain.com
domain.com A 130.71.45.31

This works well for websites, e.g. subdomain.domain.com.

Now let's say I have an MX record on the root domain.

I assumed that emails to: person@subdomain.domain.com would work, but they fail. Emails of the form person@domain.com work just fine.

Where am I going wrong?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If your MX record is for example.com, mail addressed to sub.example.com will be delivered there if and only if there is no A record for sub.example.com, AND there is no redirection taking place for sub.example.com.

Just Say No and remove the egregious CNAME:

$ORIGIN example.com.
* IN A 130.71.45.31
share|improve this answer
    
Hold on- I need the CNAME for the subdomains to point to the webserver; is it conflicting with the MX? –  chrism2671 Nov 21 '11 at 17:42
2  
No, you do not need the CNAME. –  adaptr Nov 21 '11 at 17:42
    
To clarify adaptr a bit - you can have an A record for *.example.com - you don't need a CNAME. Also, you can enter MX records for subdomain.example.com as well, which might end run this whole thing, unless you're planning on having mail send to randomthing.example.com a fair bit. –  Driftpeasant Nov 21 '11 at 19:22
    
Actually, I have to have *.example.com CNAME example.com in order to get multiple subdomains to redirect to one server. But this would break the MX right? –  chrism2671 Dec 17 '11 at 16:06

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.