How to Set Up a Vercel Custom Domain (Namecheap & Cloudflare)
Vercel custom domain setup for Namecheap & Cloudflare: the exact DNS records (A + CNAME), auto SSL, www vs apex, and the mistakes that break verification.
Your app is live on a *.vercel.app subdomain, and now you want it on a real domain. Good call — nothing says “weekend toy” like a free subdomain, and a proper domain costs about $10 a year.
I did this for a Next.js side project I hosted on Vercel. The actual work is two DNS records and about 10 minutes of clicking; the waiting for DNS propagation is what pads it out. This guide covers the two registrars I see most often — Namecheap and Cloudflare — because their DNS screens are where people get lost.
If you haven’t deployed yet, do that first: my 15-minute Vercel deploy guide gets you from local folder to live URL. And if you bought a domain through Cloudflare and are wondering whether to just host there too, I compared Vercel, Netlify, and Cloudflare Pages after using all three.
What this guide covers
- Adding a custom domain to Vercel (apex + www) in one sitting
- The exact DNS records for Namecheap and Cloudflare
- The Cloudflare proxy gotcha that silently blocks SSL
- Apex vs www, and which one to set as canonical
- The fastest fix when verification gets stuck
What you need
- A project deployed on Vercel (any framework)
- A domain you own, with access to its DNS settings
- About 10 minutes, plus propagation time
One thing to know before you start: you’re not moving your domain anywhere. It stays at your registrar. You’re just telling the internet “when someone asks for this name, send them to Vercel.” If what you actually want is to move the domain itself into Vercel’s registrar, that’s a different job — here’s when transferring a domain to Vercel is worth the hassle (spoiler: rarely).
Step 1: Add the domain in Vercel
In your Vercel dashboard, open your project, then go to Settings → Domains.
Type your domain (say yourapp.com) and click Add. Vercel will suggest adding the www version too — accept that. You want both pointing at your project; you’ll pick a primary one later.
Vercel now shows you the DNS records it expects:
- For the apex domain (
yourapp.com): an A record pointing to76.76.21.21 - For
www: a CNAME record — and here’s what trips people up — the value is unique to your project, something liked1d4fc829fe7bc7c.vercel-dns-017.com
Older tutorials tell you to use cname.vercel-dns.com. That’s outdated. Copy the exact CNAME value your dashboard shows, character for character.
Leave this tab open. You’ll come back to check verification.
Namecheap vs Cloudflare: the records at a glance
Both registrars need the same two records — only the dashboard labels differ:
| Namecheap | Cloudflare | |
|---|---|---|
| A record | Host @, Value 76.76.21.21 | Name @, IPv4 76.76.21.21 |
| CNAME (www) | Host www, your Vercel value | Name www, your Vercel value |
| Proxy setting | n/a | Turn off (grey cloud) during setup |
| Common mistake | Leftover parking records | Orange cloud left on |
The CNAME value is unique to your project — copy it from the Vercel dashboard, don’t type it by hand.
Step 2a: DNS records on Namecheap
Log in to Namecheap, go to Domain List, click Manage next to your domain, then the Advanced DNS tab.
First, clean house. A fresh Namecheap domain comes with parking records — usually a URL Redirect Record for @ pointing at their parking page, and a CNAME for www pointing at parkingpage.namecheap.com. Delete both. If you skip this, your new records fight the old ones and verification fails. This is the #1 Namecheap mistake.
Then add your two records (Add New Record):
- A Record — Host:
@, Value:76.76.21.21, TTL: Automatic - CNAME Record — Host:
www, Value: your project-specific value from Vercel (the...vercel-dns-017.comone), TTL: Automatic
Save and you’re done on the Namecheap side.
Step 2b: DNS records on Cloudflare
In your Cloudflare dashboard, select the domain, then go to DNS → Records and click Add record. Same two records:
- A — Name:
@, IPv4 address:76.76.21.21 - CNAME — Name:
www, Target: your project-specific Vercel value
Now the Cloudflare-specific gotcha: the proxy toggle. Each record has an orange-cloud “Proxied” option, on by default. Turn it off — you want DNS only (grey cloud) for both records right now.
This isn’t superstition. Vercel’s own docs say a proxied record sits between public DNS and the A record Vercel expects, which blocks both domain verification and the SSL certificate challenge. People who leave the orange cloud on end up stuck on “Failed to generate cert” in the Vercel dashboard. Once Vercel verifies the domain and issues the certificate, you can flip the proxy back on if you want Cloudflare’s caching and WAF in front — but leave it off until then.
Alternative: using Vercel’s nameservers
Instead of adding A/CNAME records at your registrar, you can hand your whole DNS over to Vercel: at your registrar, change the domain’s nameservers to ns1.vercel-dns.com and ns2.vercel-dns.com, and Vercel manages every record for you.
I don’t recommend this for a first domain. Nameserver changes propagate more slowly than record edits, and once you switch, your registrar’s DNS screen stops working — all future records (email, verification TXT, subdomains) must be added in Vercel’s dashboard instead. The A + CNAME approach above keeps your DNS where the rest of your stuff lives. The nameserver route is really for wildcard domains or people who want everything inside Vercel.
Step 3: Verification and SSL
Back in Settings → Domains on Vercel, watch the status next to your domain. It starts as “Pending” or shows a configuration warning, then flips to a healthy state once Vercel sees your records.
In my experience with Namecheap and Cloudflare, this takes 5 to 30 minutes. The official line is that DNS propagation can take up to 48 hours, but I’ve never seen it take more than an hour with these two registrars.
Once verified, Vercel automatically provisions a free SSL certificate (via Let’s Encrypt). You don’t configure anything — your site just works on https://. If you visit too early and get a certificate error in the browser, that’s normal; give it a few more minutes.
www vs apex: pick one
You now have both yourapp.com and www.yourapp.com serving your app. Don’t leave it that way — two live URLs split your SEO signals.
In Settings → Domains, Vercel lets you set a redirect from one to the other. I redirect the apex to www (which is also what Vercel recommends), but honestly either direction is fine. What matters is that one canonical URL answers and the other 301-redirects to it.
When it doesn’t work
“This domain is in use by another Vercel account.” Someone (maybe you, on an old account or an old team) already attached this domain to a Vercel project. Vercel will ask you to prove ownership with a TXT record — add it at your registrar, wait a few minutes, and verification proceeds. Note the TXT record alone doesn’t move the domain; it just lets your project use it.
Stuck on pending or “Invalid Configuration” for over an hour. Check, in order: leftover parking records at your registrar (delete them), Cloudflare proxy still on (switch to DNS only), a typo in the CNAME value (re-copy from Vercel, don’t type it). To see what the internet actually sees, run dig yourapp.com +short — it should return 76.76.21.21. If it returns a Namecheap parking IP, old records are still live.
SSL errors after the domain resolves. The certificate is issued after verification, not simultaneously. Wait 10 minutes. If it persists past an hour and you’re on Cloudflare, that proxy is almost certainly on. And if you’ve checked both of those and the browser still refuses to load your site securely, I broke down the remaining causes one by one — cert errors, redirect loops, CNAMEs that never validate, mixed content — in Vercel custom domain SSL not working.
Next steps
Domain connected, SSL green padlock, canonical URL picked — your app now looks like a real product. But if the domain connects and instead you get a “not secure” warning or a redirect loop, my Vercel SSL troubleshooting guide covers the exact Cloudflare and DNS fixes. If you’re wondering why that padlock matters beyond appearances (and whether you’d ever need to buy a certificate), I answered that in do you need to buy an SSL certificate? — short version: no. And if this DNS stuff felt like magic incantations, my beginner’s guide to buying a domain and setting up DNS makes the records actually make sense.
Frequently Asked Questions
Do I need to transfer my domain to Vercel?
No. You keep the domain at your registrar (Namecheap, Cloudflare, wherever) and just point two DNS records at Vercel. Transferring the domain itself is optional and only worth doing if you want to manage everything in one dashboard.
How long does Vercel domain verification take?
Usually 5-30 minutes once your DNS records are saved. DNS propagation can technically take up to 48 hours, but with Namecheap or Cloudflare it's almost always under an hour. If it's been longer, check for leftover parking records or a proxied Cloudflare record.
Can I keep Cloudflare's proxy (orange cloud) enabled?
Not during setup. Vercel's docs say a proxied record blocks domain verification and the SSL certificate challenge. Set the record to DNS only (grey cloud), wait for Vercel to verify and issue the certificate, then you can re-enable the proxy if you want Cloudflare's features in front.
Should I use www or the bare domain as my main URL?
Either works — pick one and redirect the other. Vercel nudges you toward www when you add an apex domain, and that's a fine default. What matters for SEO is choosing one canonical version so you don't split ranking signals between two URLs.
How do I add a custom domain to Vercel for free?
Vercel does not charge for adding a custom domain on any plan — you only pay your registrar for the domain itself (about $10/year). In Settings → Domains, add your domain and www, then point two DNS records at Vercel. No paid add-on is required.
How long does Vercel custom domain setup take?
The DNS record changes take 5–30 minutes to propagate with Namecheap or Cloudflare, and Vercel issues the SSL certificate automatically once it sees them. The official max is 48 hours, but in practice it's under an hour. If it's been longer, check for leftover parking records or a proxied Cloudflare record.
Peng Zhou
Founder of ShipToCash. I build small software products and write about the part nobody teaches you: getting your app deployed, taking real payments, and staying out of legal trouble — everything here is tested on my own projects first.
More about me →Related Articles
Git Push Not Triggering a Vercel Deploy: 9 Checks, in Order
Pushed to GitHub and Vercel did nothing? No deploy, no error. These 9 checks find the cause, starting with whether the Vercel Bot left a comment.
Netlify Build Failed: What Exit Code 2 Actually Means (3 Fixes)
'Build script returned non-zero exit code: 2' on Netlify isn't the real error. Here are the 3 causes behind it, ranked, with the exact fix for each.
Cloudflare Pages Environment Variables Not Working (5 Fixes)
Variable set in Cloudflare Pages but your build still reads undefined? Five ranked causes, including the one where secrets simply don't exist at build time.