XiaTools

Mapping DigitalOcean App Platform Endpoints with DNS Aliases

Updated 14 Oct 2026

Mapping DigitalOcean App Platform endpoints with DNS aliases allows you to route custom domain traffic directly to your cloud applications without exposing underlying IP addresses. By configuring a CNAME record or an ALIAS/ANAME record at your DNS provider, you bridge your public domain name with the default .ondigitalocean.app endpoint assigned to your app component. This process ensures your users can access your web apps via clean, branded URLs while maintaining seamless backend scaling and load balancing.

Understanding DigitalOcean App Platform Endpoints

When you deploy an application to the DigitalOcean App Platform, the system automatically assigns a default endpoint ending in ondigitalocean.app. While this URL is functional for testing, production environments require custom domains. DigitalOcean routes incoming traffic through its edge network, which terminates TLS and forwards requests to your containers or static sites.

To point your own domain to this infrastructure, you cannot simply use an A record with a static IP address. DigitalOcean's architecture uses dynamic load balancers whose IP addresses can change. Instead, you must use DNS alias mechanisms—specifically CNAME records for subdomains and ALIAS or ANAME records (or Cloudflare-specific flattening features) for apex domains like example.com.

Before you start updating your DNS records, it is best to verify your current configuration state using the CNAME Lookup tool on XiaTools to confirm existing pointer targets and troubleshoot propagation delays.

Step-by-Step Guide: Adding a Custom Domain in DigitalOcean

To map your DNS aliases successfully, you must first register the domain inside your DigitalOcean control panel so their edge routers know how to handle incoming HTTP Host headers for your app.

Step 1: Configure the Domain in the Dashboard

  1. Log in to your DigitalOcean account and navigate to the App Platform section.
  2. Select your application from the list of deployed projects.
  3. Click on the Settings tab at the top of the app dashboard.
  4. Locate the Domains section and click the Edit or Add Domain button.
  5. Enter your fully qualified domain name (e.g., app.example.com or example.com) and click Save.

DigitalOcean will provide you with the target CNAME value you need to configure at your DNS host. This target typically looks like your-app-name-rand.ondigitalocean.app or points to a regional ingress balancer.

Configuring DNS Alias Records

Once DigitalOcean recognizes your domain, you must create the corresponding DNS records at your domain registrar or external DNS provider (such as Cloudflare, AWS Route 53, or Namecheap). Note that specific menu paths and terminology may differ slightly depending on your provider.

Configuring a Subdomain (CNAME Record)

For subdomains like app.example.com, standard CNAME records are fully supported across all DNS providers.

  1. Log into your DNS provider's management console.
  2. Navigate to the DNS zone editor for example.com.
  3. Create a new record with the following parameters:
    • Type: CNAME
    • Name / Host: app
    • Value / Target: your-app-name-rand.ondigitalocean.app
    • TTL: 3600 (or Automatic)
  4. Save the record.

Configuring an Apex Domain (ALIAS, ANAME, or Flattening)

DNS standards traditionally forbid CNAME records on root or apex domains (e.g., example.com). To map an apex domain to your App Platform endpoint, use your provider's proprietary root-level alias feature.

  • Cloudflare: Use a standard CNAME record for @. Cloudflare automatically applies "CNAME Flattening" to resolve it.
  • AWS Route 53: Create an A record, toggle Alias to Yes, and select the target or paste your App Platform endpoint.
  • Other Providers (DigitalOcean DNS, DNSimple, etc.): Create an ALIAS or ANAME record pointing @ to your ondigitalocean.app target.

Verifying Your DNS Mapping

After creating your DNS records, you must verify that the resolution works correctly and points to the right target. You can use command-line diagnostic utilities to inspect the DNS propagation.

Using Dig

Run the following command in your terminal to check the CNAME chain:

dig app.example.com CNAME +noall +answer

Expected output:

app.example.com.	300	IN	CNAME	your-app-name-rand.ondigitalocean.app.

Using Nslookup

On Windows PowerShell or standard Unix shells, use nslookup:

nslookup -type=CNAME app.example.com

Troubleshooting SSL/TLS and Connectivity

DigitalOcean automatically provisions free Let's Encrypt SSL certificates for custom domains added to the App Platform, provided your DNS records resolve correctly. If your app returns certificate errors or fails to load, check for these common issues:

Issue Cause Solution
DNS Propagation Delay Global DNS servers have not updated yet. Wait up to 30 minutes, or flush your local DNS cache using ipconfig /flushdns or sudo systemctl restart systemd-resolved.
Invalid CNAME Target Typo in the ondigitalocean.app target string. Review your DigitalOcean dashboard settings and ensure the target string matches exactly without trailing periods.
Proxy / CDN Interference Cloudflare orange-cloud proxy is active without SSL mode set to Full/Strict. Set Cloudflare proxy to DNS-only during initial validation, or configure SSL/Strict mode in Cloudflare dashboard.

To test your HTTPS connection and inspect the SSL certificate presented by DigitalOcean's edge, run this curl command:

curl -Iv https://app.example.com

Checklist for Mapping App Platform Endpoints

  • Added the custom domain in the DigitalOcean App Platform settings.
  • Copied the exact ondigitalocean.app target string.
  • Created a CNAME record for subdomains or an ALIAS/ANAME/Flattened record for apex domains.
  • Verified record propagation using dig or an online DNS lookup tool.
  • Confirmed automatic TLS certificate generation and HTTPS accessibility.

Frequently asked questions

Can I map a root domain like example.com to DigitalOcean App Platform?

Yes, but because DNS standards do not allow CNAME records on root domains, you must use an ALIAS, ANAME, or CNAME-flattening feature provided by your DNS host. Alternatively, you can redirect your apex domain to a subdomain like www.example.com using your DNS provider's URL redirection settings.

How long does it take for DNS changes to propagate?

DNS propagation typically takes anywhere from 5 minutes to a few hours, depending on the Time To Live (TTL) values set on your previous records and global ISP caching behaviors. You can check real-time global propagation using online DNS lookup utilities.

Why is DigitalOcean failing to issue an SSL certificate for my custom domain?

DigitalOcean cannot issue a Let's Encrypt certificate if your DNS records are not pointing correctly to the App Platform endpoint or if a CDN proxy (like Cloudflare with the orange cloud enabled) is blocking validation challenges. Ensure your DNS record is active and direct before checking the dashboard again.

What should I do if my app shows a 502 Bad Gateway error after mapping?

A 502 error usually means your DNS alias is working and reaching DigitalOcean's edge, but the edge cannot communicate with your app container. Check your application logs in the DigitalOcean control panel to ensure your web server is running and listening on the correct internal port.

Can I map multiple domains to a single DigitalOcean App Platform app?

Yes, the App Platform allows you to attach multiple custom domains and subdomains to a single app component. Each domain must be added individually in the control panel and paired with its own DNS records at your registrar.

Related articles

Free tools