Domain Name System – How to Set Up MX Record for Subdomains

domain-name-systemmx-record

I want to be able to send email to any subdomain I like and not have to configure A records and MX records for each subdomain. Ideally I could send an email to test@a.domain.com and test@z.domain.com and not have to configure anything other than my original domain.com.

My current setup:

I have a domain (domain.com) and want to have multiple subdomains. (a.domain.com, b.domain.com, c.domain.com, etc).

I have an MX record setup to point to domain.com and all email works fine for that domain. I have NOT setup A records for all the subdomains (and really don't want to).

Best Answer

If you have no other resource records of any kind for the subdomains, then a wildcard record will work just fine. This assumes that the subdomains don't need different A records from one another, or maybe no A records at all - is this the case?

You can either set just the wildcard MX record, as well as an A record if you need it..

*    IN    MX    15    your.mail.server.example.com.
*    IN    A     192.0.2.15

..or else create a wildcard CNAME record pointing to the root, if it already has the correct entries.

*    IN    CNAME    @
Related Topic