Some links go through /go/ and may earn us a commission at no extra cost to you. We only recommend tools we would use.
To set up a Vercel custom domain (or one on Netlify or Cloudflare), add the domain in your hosting platform's settings, then create the DNS records it asks for at your DNS provider: an A record (or ALIAS) for the apex domain like example.com, and a CNAME for www. On Vercel, use the project-specific values shown under Settings → Domains. On Netlify, point the apex at apex-loadbalancer.netlify.com (ALIAS) or 75.2.60.5 (A record) and www at your *.netlify.app name. On Cloudflare Workers, add a Custom Domain and Cloudflare creates the records and certificate for you, as long as the domain's DNS is on Cloudflare. HTTPS is issued automatically on all three once DNS resolves.

Before you start: apex vs www
The apex (or root) domain is
example.com. DNS rules do not allow a normal CNAME at the apex, so platforms give you an A record IP or ask for an ALIAS, ANAME or flattened CNAME if your provider supports one.A subdomain such as
www.example.comorapp.example.comuses a CNAME pointing at the platform.Pick one canonical host and redirect the other to it, so search engines do not see two copies of your site. Vercel's docs recommend using
www; Netlify's docs also recommend a subdomain as your primary domain when you use external DNS, because the apex cannot benefit from CDN-level DNS routing.
You need access to wherever your domain's DNS is managed. That is usually your registrar (Namecheap, Porkbun) unless you moved nameservers to Cloudflare or your host. Not bought one yet? See best domain registrar for developers.
Vercel custom domain setup
Open your project, go to Settings → Domains, and add
example.com. Vercel will prompt you to addwww.example.comas well.Vercel shows the records it expects. For the apex, add an A record with the recommended IP. For
www(or any subdomain), add a CNAME with the recommended project-specific target. Use the values shown for your project rather than an IP copied from a blog post.Wait for the domain to show as valid. Vercel issues the certificate automatically.
Set a redirect between
example.comandwww.example.comin the project's domain settings so only one serves the site.
Prefer the terminal? The Vercel CLI does the same:
vercel domains add example.com my-site
vercel domains add www.example.com my-site
vercel domains verify www.example.com --project my-site Alternatively, you can switch your domain's nameservers to Vercel and let it manage DNS. Wildcard domains (*.example.com) need the nameserver method or an _acme-challenge delegation for certificates.
Netlify
In your site, go to Domain management and add your custom domain.
For
wwwor another subdomain, add a CNAME at your DNS provider pointing to your site's Netlify name, for examplebrave-curie-12345.netlify.app.For the apex, Netlify gives two options:
Recommended: an ALIAS, ANAME or flattened CNAME record at
@pointing toapex-loadbalancer.netlify.com.Fallback: an A record at
@pointing to75.2.60.5.
Sites on Netlify's High-Performance Edge use a different load balancer: use the value shown in the "Pending DNS verification" details instead.
Netlify adds
wwwautomatically when you assign an apex domain, and provisions HTTPS once DNS resolves. Netlify notes propagation can take up to a day.
As an alternative, you can use Netlify DNS by pointing your nameservers to Netlify.
Cloudflare Workers (and Pages)
Cloudflare is simplest if your domain's DNS is already on Cloudflare, because it creates the records for you.
Get the domain onto Cloudflare DNS if it is not already. Add the domain in the dashboard, then change the nameservers at your registrar to the two Cloudflare assigns. Turn off DNSSEC at the registrar first, as Cloudflare's setup guide instructs. Domains bought through Cloudflare Registrar already use Cloudflare DNS.
Go to Workers & Pages, select your Worker, then Settings → Domains & Routes → Add → Custom Domain, and enter
example.comorapp.example.com.Cloudflare creates the DNS record and issues the certificate. All paths on that hostname go to your Worker.
Or declare it in your Wrangler config and deploy:
{
"routes": [
{ "pattern": "shop.example.com", "custom_domain": true }
]
} One gotcha from Cloudflare's docs: you cannot create a Custom Domain on a hostname that already has a CNAME record. Delete the old record first.
Troubleshooting
Symptom | Likely cause | Fix |
|---|---|---|
"Invalid configuration" for days | Record added at the wrong DNS provider | Check where nameservers point ( |
Apex works, | Only one record added | Add both, then redirect one to the other |
Certificate pending | DNS not resolving to the platform yet, or a CAA record blocks issuance | Wait for propagation; check CAA records |
"CNAME not allowed at root" | Your DNS provider does not support apex CNAMEs | Use the A record IP or an ALIAS/ANAME |
Cloudflare refuses Custom Domain | Existing CNAME on that hostname | Delete the CNAME, then add the Custom Domain |
Old site still shows | DNS caching | Wait for the TTL to expire; test with |
After the domain works
Update your app's base URL and canonical URL settings (
SITE_URL,NEXTAUTH_URLor your framework's equivalent).Update OAuth redirect URLs at Google, GitHub and others, plus payment webhook endpoints.
Set up email records (SPF, DKIM, DMARC) if you send email from the domain.
The rest of the launch list is in the vibe-coded app production checklist. Choosing between these three hosts? See Vercel vs Netlify vs Cloudflare Pages.
FAQ
How long does it take for a custom domain to work?
Often minutes, sometimes longer. Netlify notes DNS propagation can take up to a full day. Nameserver changes, for example moving to Cloudflare, can take longer than adding a single record.
Should I use www or the root domain?
Either works if you redirect the other. Vercel recommends www, and Netlify recommends a subdomain as primary when you use external DNS, because the apex cannot use CDN-level DNS routing.
Do I need to buy an SSL certificate?
Vercel, Netlify and Cloudflare issue and renew certificates automatically once your DNS points to them.
Can I use a domain from Namecheap or Porkbun with Vercel?
Yes. Add the domain in Vercel, then create the A and CNAME records Vercel shows in your registrar's DNS settings. Or change the nameservers to Vercel and manage DNS there.
Why can't I add a CNAME for my root domain?
The DNS standard does not allow a CNAME at the apex alongside the other records a root domain needs. Use the A record the platform provides, or an ALIAS, ANAME or flattened CNAME if your DNS provider supports one.
Want the launch handled?
Kavio sets up domains, DNS, HTTPS, redirects and email records for AI-built apps, and checks the rest of your launch list. See our services or get in touch.

