Multiple Realm Apps linking to Same Domain, Multiple Subdomains

I’ve been trying to link a dev realm app and a production realm app to different subdomains. So the dev one would go to dev.example.com and the production one would go to app.production.com. For some reason the production app will not successfully verify the custom domain I am providing. I have had the CNAME record for verification in place for over 24 hours.

Additionally, something strange is going on when I got o app.example.com. It is showing me the development realm app. Not sure what is going on there. It might be worth noting I have already created a CNAME record for app.example.com that is pointing to my mongodbstitch.com domain. Not sure if that has anything to do with it.

My questions are:

  1. Are there any problems with linking multiple realm apps to the same custom domain?
  2. Are there any obvious reasons why custom domain verification would not work?
  3. Why would my production subdomain be pointing to my development app when dev.example.com CNAME points to my development mongodbstitch.com domain?

Thanks!

1 Like

Hi @Lukas_deConantseszn1,

In your case app and dev are your subdomains and not the domain name. I honestly not sure what happens if two different apps are only differed by a subdomain but I can find out.

I am afraid we might only query the domain name which is already mapped to dev and that could explain why you eventually get routed to it.

Please verify that you do not have something mentioned in the note boxes
https://docs.mongodb.com/realm/hosting/use-a-custom-domain-name/#specify-the-custom-domain-in-realm

Also what dns service do you use?

Best
Pavel

Hi @Pavel_Duchovny,

That’s right. So you are thinking it could possibly be fixed by removing the CNAME to dev.example.com?

My DNS is DigitalOcean, but the domain is registered through 101Domains where I have manually updated the nameserver records to point to DigitalOcean.

I don’t believe that DigitalOcean proxies domain requests from what I’ve read, but I’m not 100% sure.

Hi @Lukas_deConantseszn1,

According to our engineers the subdomain configuration should work - just need to specify the full domain, including the subdomain itself, when configuring it for each app.

Can you share your application links? And a screen shot of dns config

Best
Pavel

Hi @Pavel_Duchovny

After using the subdomain for the custom domain, it seemed to work! I was confused because previously for my development site for dev.example.com, I had set the custom domain to just example.com and that’s how it had worked.

1 Like