Internet & Web  

Complete Guide: Mapping a Custom Subdomain to a Render Cloud Service

Connecting a custom subdomain managed on a domain registrar like GoDaddy (e.g., api.yourdomain.com) to an application hosted on Render (your-api-app.onrender.com) establishes a professional API endpoint, enables automated SSL/TLS termination, and simplifies service routing.

This end-to-end technical guide covers registering the host target on Render, updating DNS records in GoDaddy, verifying propagation, and configuring cross-origin resource sharing (CORS).

Technical Overview & Architecture

User Request ──> https://api.yourdomain.com
                        │
                        ▼ (GoDaddy DNS - CNAME)
            your-api-app.onrender.com
                        │
                        ▼ (Render Edge Router)
             Render Container Instance
  • Domain Registrar & DNS: GoDaddy (yourdomain.com)

  • Target Host Service: Render (your-api-app.onrender.com)

  • Desired Endpoint: [https://api.yourdomain.com](https://api.yourdomain.com)

  • Routing Protocol: CNAME (Canonical Name) Alias Record

Step 1: Register the Custom Subdomain in Render

Before adding DNS records at your registrar, Render must be configured to accept and bind incoming requests for the target hostname.

  1. Log in to the Render Dashboard.

  2. Open your Web Service (e.g., your-api-app).

  3. In the left navigation menu, click Settings.

  4. Scroll down to the Custom Domains section.

  5. Click Add Custom Domain.

  6. Enter api.yourdomain.com in the text field.

  7. Click Save Changes.

Note: Render will display a status indicator showing DNS update needed or Unverified along with the expected target hostname (your-api-app.onrender.com).

Step 2: Create the CNAME Record in GoDaddy DNS

Next, instruct GoDaddy's domain servers to route requests for api to your Render deployment target.

  1. Log in to your GoDaddy Domain Portfolio.

  2. Locate yourdomain.com in your list of domains and select DNS (or Edit DNS).

  3. On the DNS Management page, locate the DNS Records table and click Add New Record.

  4. Fill in the record parameters:

FieldValueExplanation
TypeCNAMEDefines an alias host pointing to another domain name.
Name (Host)apiEnter only api (do not write api.yourdomain.com).
Value (Data / Target)your-api-app.onrender.comYour Render default service address.
TTL600 seconds (10 Min)Time-To-Live for DNS caching across resolvers.
  1. Click Save to apply the record to GoDaddy's name servers.

Step 3: Domain Verification & TLS Certificate Provisioning

Once the DNS record is published on GoDaddy, Render must verify ownership before issuing a Let's Encrypt TLS/SSL certificate.

  1. Return to the Custom Domains panel in your Render service settings.

  2. Click Verify next to api.yourdomain.com.

  3. Render queries global DNS servers to confirm the CNAME record points to your-api-app.onrender.com.

  4. Once verified, Render automatically provisions a managed SSL/TLS certificate. Status changes to Verified.

DNS updates usually take 5–15 minutes, though complete global propagation across all ISP resolvers can take up to a few hours.

Step 4: Configure CORS & Server Middleware

If a frontend hosted on yourdomain.com or [www.yourdomain.com](https://www.yourdomain.com) makes AJAX/Fetch requests to api.yourdomain.com, your API server must explicitly permit cross-origin requests.

.NET / C# (ASP.NET Core) Example

In your Program.cs file, enable CORS for the frontend origin:

C#

var builder = WebApplication.CreateBuilder(args);

// Define allowed originsvar allowFrontendOrigins = "_allowFrontendOrigins";

builder.Services.AddCors(options =>
{
    options.AddPolicy(name: allowFrontendOrigins,
        policy =>
        {
            policy.WithOrigins("https://yourdomain.com", "https://www.yourdomain.com")
                  .AllowAnyHeader()
                  .AllowAnyMethod();
        });
});

var app = builder.Build();

app.UseCors(allowFrontendOrigins);
app.UseAuthorization();
app.MapControllers();

app.Run();

Node.js (Express) Example

JavaScript

const express = require('express');
const cors = require('cors');
const app = express();

const corsOptions = {
  origin: ['https://yourdomain.com', 'https://www.yourdomain.com'],
  methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
  allowedHeaders: ['Content-Type', 'Authorization']
};

app.use(cors(corsOptions));

Step 5: Verification & Testing

Verify that DNS resolution, network routing, and SSL certificates are working using command-line diagnostic tools.

1. Test DNS Resolution

Run nslookup or dig in your terminal to confirm the CNAME points to Render:

Bash

nslookup api.yourdomain.com

Expected Output:

Plaintext

Non-authoritative answer:
api.yourdomain.com   canonical name = your-api-app.onrender.com.
Name:   your-api-app.onrender.com
Addresses:  216.24.57.x

2. Test Secure HTTPS Connectivity

Execute a curl request to verify HTTP response codes and SSL termination:

Bash

curl -I https://api.yourdomain.com/healthcheck

Expected Output:

HTTP

HTTP/2 200 
date: Sat, 08 Aug 2026 21:16:00 GMT
content-type: application/json
server: Render

Troubleshooting Common Bottlenecks

  • Record Already Exists Error in GoDaddy: If GoDaddy displays An unexpected error occurred, check if an existing A record or CNAME record with Name api already exists in the table. Delete or edit the old record before saving.

  • Verification Delayed in Render: If Render displays Verification Failed, flush your local DNS cache (ipconfig /flushdns on Windows or sudo dscacheutil -flushcache on macOS) and wait 5 minutes for DNS cache TTL expiration.

  • SSL Certificate Pending: Render's certificate issuer requires DNS records to be publicly propagated before issuing certificates. Ensure there are no CAA DNS records blocking Let's Encrypt on yourdomain.com.