Routing your custom domain to a Replit project is deceptively straightforward until an edge proxy gets in the way. At 365Finds, we look at developer infrastructure through a pragmatic lens: tools should eliminate boilerplate configuration without hiding critical DNS mechanics. Replit handles automated TLS issuance and edge reverse proxying quite well, but only if you respect its specific routing constraints.
Here is exactly how custom domain routing and automated SSL certificates work on Replit, what DNS records you actually need, and the recurring configuration traps that break HTTPS provisioning.
The Deployment Prerequisite
Before touching any DNS dashboard, your project must be deployed. In older iterations of Replit, developers could point domains to interactive development workspaces. That model is deprecated.
Today, custom domain binding attaches directly to Replit Deployments (whether you choose Autoscale, Reserved VM, or Static deployment).
- Ensure your application is published and successfully responding on its generated subdomain (e.g.,
https://your-project.replit.app). - Test basic application health. If your deployed container crashes on boot or throws HTTP 500 errors, Replit's edge gateway cannot properly route health checks, which complicates troubleshooting later.
Step-by-Step Custom Domain Configuration
You have two avenues: purchasing a domain directly through Replit, or pointing an external domain from registrars like Cloudflare, Namecheap, GoDaddy, or Porkbun.
At 365Finds, we firmly advise maintaining your domain registration at a dedicated external registrar rather than bundling it inside your compute platform. Decoupling DNS and compute keeps your infrastructure portable.
1. Generating DNS Records in Replit
- Open your project workspace in Replit.
- Navigate to Publishing in the left sidebar, or open Deployments settings and select the Domains tab.
- Click Connect your own domain.
- Enter your fully qualified domain name (for example,
app.example.comfor a dedicated subdomain, orexample.comfor an apex root domain). - Click Next / Continue. Replit will inspect the entry and output two distinct DNS records:
- An A Record: Pointing to Replit’s ingress load balancer IP address.
- A TXT Record: A verification key (e.g.,
replit-verify=<token>) used to prove domain control and authorize automated certificate provisioning.
2. Entering DNS Records at Your Registrar
Head over to your registrar’s DNS management console and insert the exact values provided by Replit.
| Record Type | Host / Name | Target / Value | Purpose |
|---|---|---|---|
| A | @ (or subdomain like app) | Replit Gateway IP provided in dashboard | Routes incoming IPv4 traffic to Replit proxy |
| TXT | @ (or subdomain like app) | Verification hash from Replit | Authorizes domain ownership and Let's Encrypt validation |
Two critical rules on DNS record types:
- No CNAME for Apex Domains: Do not attempt to add a CNAME record on the root domain (
example.com). Replit’s ingress relies on an A record for root domains. - Apex and WWW are Distinct: If you want visitors to reach your app via both
example.comandwww.example.com, you must register both names inside Replit’s domain manager. Replit does not issue wildcard (*.example.com) certificates.
3. Verification and SSL/TLS Certificate Provisioning
Once DNS records are published:
- Return to the Replit Domains interface and click Verify.
- Replit queries public DNS resolvers to confirm that the A and TXT records resolve correctly.
- When DNS propagation completes, Replit’s edge proxy triggers automated certificate generation (typically backed by Let's Encrypt or Google Trust Services).
- Replit terminates TLS at its edge ingress, enforces HTTPS redirection across all HTTP requests, and injects HTTP Strict Transport Security (HSTS) headers.
In clean network conditions, the entire handshake resolves in two to ten minutes. In worst-case propagation delays, it can take several hours.
Three Traps That Break Replit SSL
Almost every failed Replit custom domain setup we investigate at 365Finds boils down to one of these three mistakes:
1. The Cloudflare "Orange Cloud" Proxy Conflict
If you manage DNS through Cloudflare, Cloudflare's default setting is to proxy traffic through its own CDN edge (indicated by the Orange Cloud icon).
This breaks Replit's automated verification. Replit’s ACME challenge needs to speak directly to the origin verification endpoint. If Cloudflare intercepts the HTTP-01 challenge or returns its own edge certificate before Replit validates the domain, Replit hangs indefinitely on "Validating" or fails certificate issuance.
The Fix: Set the proxy status in Cloudflare to DNS Only (the Grey Cloud) for both the A and TXT records during setup. Leave it unproxied unless you explicitly configure Cloudflare origin certificates and full SSL modes.
2. Deleting the TXT Verification Record
After the domain status turns green and HTTPS works, some engineers tidy up their DNS zone files and delete the replit-verify TXT record.
Do not touch it. Modern managed SSL certificates expire every 60 to 90 days. Replit’s background daemon requires the TXT record to automatically re-verify ownership and renew the certificate without dropping traffic. If the record is missing, renewal fails silently until your site starts throwing untrusted certificate warnings.
3. Idle Deployments and Cold Boot 502s
When using Replit's Autoscale deployments, containers spin down to zero instances during inactivity to conserve deployment compute units.
When a user visits your custom domain after an idle period, Replit's edge proxy initiates a cold boot. If your application takes longer than 10–15 seconds to spin up, users may see an initial 502 or 504 gateway timeout. That is not an SSL certificate failure or a routing misconfiguration—it is the operational reality of scale-to-zero compute. If continuous sub-second uptime is mandatory for your brand domain, 365Finds recommends switching your Replit Deployment configuration from Autoscale to a Reserved VM.
Replit's ingress proxy routes production traffic reliably once DNS and verification records are locked in place. The key is leaving the TXT record permanently attached and keeping external proxy layers out of the verification path.