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.
Log in to the Render Dashboard.
Open your Web Service (e.g., your-api-app).
In the left navigation menu, click Settings.
Scroll down to the Custom Domains section.
Click Add Custom Domain.
Enter api.yourdomain.com in the text field.
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.
Log in to your GoDaddy Domain Portfolio.
Locate yourdomain.com in your list of domains and select DNS (or Edit DNS).
On the DNS Management page, locate the DNS Records table and click Add New Record.
Fill in the record parameters:
| Field | Value | Explanation |
|---|
| Type | CNAME | Defines an alias host pointing to another domain name. |
| Name (Host) | api | Enter only api (do not write api.yourdomain.com). |
| Value (Data / Target) | your-api-app.onrender.com | Your Render default service address. |
| TTL | 600 seconds (10 Min) | Time-To-Live for DNS caching across resolvers. |
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.
Return to the Custom Domains panel in your Render service settings.
Click Verify next to api.yourdomain.com.
Render queries global DNS servers to confirm the CNAME record points to your-api-app.onrender.com.
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.