Does creating MX record on a subdomain makes subdomain resolution to fail?

I have created a wildcard subdomain. If a new subdomain is created(in my system), it immediately creates an MX record on(Cloudflare). Accessing subdomain after that gives DNS_PROBE_FINISHED_NXDOMAIN on browser & pings to the domain fails with Unknown host. I added some delay in creating MX record, with the intention to access the subdomain before it gets created. Now, the subdomain loads without any issues. Is this observatoin correct? Does creating MX records before a subdomain is queried on name server causes the subdomain resolution to fail? How do I solve this? Another issue is that, the subdomains that were previously not resolved, never gets resolves. Only when individual A records are created, they began to work! Both of these problems makes it really difficult to work wildcard subdomains. Could someone point me towards the right resources to resolve these issues?
7 Replies
Erisa
Erisa5mo ago
This is DNS working by design, see e.g. https://stackoverflow.com/a/32164140
Stack Overflow
Do MX Records interfere with wildcard CNAME records?
I've got a wildcard CNAME record defined on my domain (*.mydomain.com) So, a user at foo.mydomain.com would resolve correctly. I then went and defined a specific MX record: foo.mydomain.com and p...
Erisa
Erisa5mo ago
Not unique to Cloudflare, just how DNS was designed and how the specification was written. In your case you will have to work around this by ensuring that explicit A/AAAA/CNAME records exist for subdomains that have those MX or other records A CNAME is probably easiest to avoid duplicating the same IP across multiple records
Tamil Vendhan Kanagarasu
Thanks for the quick response. It is helpful in understanding the problem. However, ensuring explicit records for subdomains is not feasible for us. Because, we have already hit the max records limit yesterday, after which we've rolled out this wildcard based solution(Only to get hit by this problem immediately). Are you able to see any other way around for us here?
Erisa
Erisa5mo ago
Not really, sorry. This behaviour is controlled by the DNS standard and not something we can override or change. All I can recommend is if you're on a free plan then upgrading to a paid plan will increase the number of DNS records you can create
Tamil Vendhan Kanagarasu
Oh, is it possible to increase record limits? What would be the limit size of Pro plan?
James
James5mo ago
The limit is not well documented but it’s 1k on free, and 3.5k on paid. With an enterprise agreement, you can increase that further.
Tamil Vendhan Kanagarasu
It is good to know that. I can upgrade to Pro plan, I am assuming it also comes with 3.5k records. In the dashboard, upgrading to Pro option is disabled. Only Business & Enterprise are enabled. Could you show a way forward? Nevermind! It is done.