How to Manage Domains in App Platform

By default, your app will be given a sub-domain on ondigitalocean.app. You can also register a custom domain.

Add a Custom Domain

Go to https://cloud.digitalocean.com/apps, click on your app, and click on the Settings tab. Then, click the Edit link to the right of Domains, and the Add Domain button.

On the Add Domain form, enter your custom domain name at the top of the form in the text area under Domain or Subdomain Name, then click to proceed.

You are given a choice to delegate your DNS management to DigitalOcean or to point to your app by adding a CNAME record to your domain configuration.

Option 1: Using DigitalOcean’s Nameservers

Domain add screen with Delegate to DigitalOcean selected

If you decide to use DigitalOcean’s nameservers, copy and paste DigitalOcean’s nameservers (ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com) to your domain’s registrar nameserver records. See our Community tutorial on how to delegate your domain to DigitalOcean’s nameservers from popular registrars.

DNS changes can take up to 72 hours to propagate across the internet. You can check the progress of the transfer in App Platform’s dashboard.

Option 2: Using a CNAME Pointer

Domain add screen with Point to DigitalOcean selected

You can also add a CNAME record to your domain. If your DNS provider is not DigitalOcean, reference your DNS provider’s documentation to see how to do this.

Use the “copy” button to copy the ondigitalocean.app alias, and paste it into the CNAME record on your DNS provider so that it points your custom domain to your App Platform app. When this is complete on your DNS provider, click the Add Domain button.

You can also add apex wildcard domains. App Platform validates the wildcard domain and issues certificates using TXT records.

TXT validation instructions

To validate, click Instructions and copy the TXT Name and TXT Value.

TXT validation instructions

Add the values to your DNS provider to validate the wildcard domain.

You will receive a control panel and an email notification 30 days prior to the token expiration. To re-validate the domain, copy the new TXT Name and TXT Value and add them to your DNS provider.

DNS changes can take up to 72 hours to propagate across the internet. You can check the progress of the transfer in App Platform’s dashboard.

Create a Wildcard Record for Domain

Wildcard DNS records direct requests for non-existent subdomains to a specified resource or IP address. For example, a wildcard record for *.example.com would mean that a DNS query for a non-existent domain like support.example.com would redirect to the domain’s homepage.

In App Platform, you can add a wildcard record to your app’s domain to redirect queries for non-existent subdomains to the domain’s root.

Before you can add a wildcard domain, you must add the root domain to your app first.

To add a wildcard record to your app, go to your app’s Overview page and then select the Settings tab. In the Domains section, click Edit and then click Add Domain.

In the Domain or Subdomain Name field, enter an asterisk followed by a dot and then your domain. For example, *.example.com. The asterisk denotes that this is a wildcard record. Once you’ve entered the wildcard domain, click Add Domain.

Wildcard domain entered into field

DNS queries for non-existent subdomains now redirect to the root domain of your app.

View DNS Provider Instructions

Go to https://cloud.digitalocean.com/apps, click on your app, and click on the Settings tab. Then click the Edit link to the right of Domains.

Click the triple-dot () menu item next to the custom domain name, and click View Instructions to view the instructions to register your domain with your DNS provider.

Remove domain

Delete a Custom Domain

Go to https://cloud.digitalocean.com/apps, click on your app, and click on the Settings tab. Then click the Edit link to the right of Domains.

Click the triple-dot () menu item, and click Remove Domain to remove a domain that is associated with your app.