Navigation

Use a Custom Domain Name

On this page

You can use your own custom domain name for your hosted content. By default, content that you upload is available at a domain with the following form:

<Your App ID>.mongodbstitch.com

You can configure a custom domain name for your application's hosted content from the Realm UI or by importing an application configuration directory that specifies the domain in its config.json configuration file. Select the tab below that corresponds to the method you want to use.

1

You must own the custom domain name that you want to serve content from. If you don't already own the domain that you want to use, you will need to purchase it from a domain name registrar.

2

You need to provide your custom domain name to MongoDB Realm before it will serve content from the domain. To specify the domain:

  1. Click Hosting in the left navigation menu.
  2. Click the Settings tab.
  3. Under Custom Domain, set the toggle to Enabled.
  4. Enter your custom domain in the input box under the Enabled toggle. This value should be the root domain without any subdomains. For example, you should enter example.com instead of www.example.com.
  5. Click Save.
Info With Circle IconCreated with Sketch.Note

If an error is encountered during custom domain name validation, Realm sends the project owner an email alerting them of the issue.

3

To verify that you own the domain you must add a new CNAME record in your domain's DNS configuration. The Custom Domain section will include an information box that lists the host name and target value to use in the record.

Once you have added the validation record it may take some time for the DNS record to propagate. Realm will periodically check the domain's DNS records for the validation CNAME and will mark the domain as verified if it finds the record.

Info With Circle IconCreated with Sketch.Note

Realm may not be able to find the validation record if your DNS provider proxies requests for the domain. If Realm cannot validate your domain, ensure that you have disabled any HTTP proxies for the validation CNAME record on your DNS provider.

Info With Circle IconCreated with Sketch.Note

If an error is encountered during custom domain name validation, Realm sends the project owner an email alerting them of the issue.

4

Once Realm has verified your domain, all that's left is to add a CNAME DNS record for your domain that points to the default Realm domain. Use the following host name and target value:

ValueDescription
Host NameA subdomain such as www.
Target

The default domain for your application. This value is listed as the Realm Domain in the Settings tab of the Hosting page. The default domain has the following form:

<Your App ID>.mongodbstitch.com
Give Feedback