I am setting up MX records for a domain and subdomains, and I want to use an MX wildcard if possible to avoid having to repeat the entries again and again.
However, I cannot work out how to do it, given the restriction that each subdomain needs its own A record (and www A record).
Simplistically, this is what I have:
a.emails.co.test 10 mailserver10.example
a.emails.co.test 20 mailserver20.example
b.emails.co.test 10 mailserver10.example
b.emails.co.test 20 mailserver20.example
c.emails.co.test 10 mailserver10.example
c.emails.co.test 20 mailserver20.example
In actuality, I have 25 country subdomains and more could come online.
All of the MX records need to point to the same mailserver(s). Every email comes into a single central location.
However, each of the subdomains has its own webserver that is managed locally, so I cannot just use a wildcard to point all of them to the same place.
There are also various other records relating to some of the subdomains, but just one is enough to scupper my initial idea of setting up the MX records thus:
*.emails.co.test 10 mailserver10.example
*.emails.co.test 20 mailserver20.example
This doesn't work of course, since the existence of any subdomain record irrespective of record type (e.g. www.b.emails.co.test
) neuters the wildcard entry.
We have four mailservers in the MX priority list, and (currently) 25 subdomains, meaning I have to put in 100 MX records.
If any of the mailservers change their canonical names (a reasonable probability if it moves to another provider) then I'll have to change 25 (at least) MX records each time. Not often, but hey!
Finally, it just looks crap having all those MX records repeating - there must be a better way??
So, any suggestions on how to do it differently?