How to set up custom domain on Vercel
Add your domain via Vercel Dashboard (Project > Settings > Domains) or CLI with <code>vercel domains add example.com</code>, configure DNS records at your registrar (A record 76.76.21.21 for apex, CNAME to cname.vercel-dns.com for www), verify with <code>vercel domains inspect</code>, set as primary, and wait for propagation (typically minutes). Vercel auto-provisions SSL once valid.
Prerequisites
- A deployed Vercel project (run <code>vercel link</code> if not linked)
- A purchased custom domain from a registrar like GoDaddy or Google Domains
- Access to your domain registrar's DNS settings
- Vercel CLI installed (optional, for inspect and DNS commands)
- Basic familiarity with DNS concepts like A and CNAME records
Step-by-Step Instructions
Navigate to Domains settings
Add your custom domain
example.com for apex or www.example.com for subdomain). Vercel may prompt to add the www subdomain for redirects (recommended). For wildcards like *.example.com, nameservers verification is required. CLI alternative: vercel domains add example.comReview required DNS records
vercel domains ls to list, then vercel domains inspect example.com to see project-specific values like A to 76.76.21.21 or CNAME to cname.vercel-dns.com or a unique alias like d1d4fc829fe7bc7c.vercel-dns-017.com. Always use inspected values.Configure DNS at your registrar
@ or example.com), Type A, Name @, Value 76.76.21.21 (confirm via inspect). For subdomain (www), Type CNAME, Name www, Value cname.vercel-dns.com (or project-specific). Delete conflicting records first. For wildcards, set Vercel nameservers like ns1.vercel-dns.com. CLI with Vercel DNS: vercel dns add example.com '@' A 76.76.21.21
vercel dns add example.com www CNAME cname.vercel-dns-0.comVerify the domain configuration
vercel domains inspect example.com. If domain owned by another account, add provided TXT record. Test with vercel curl / or browser.Set as primary domain
Configure redirects (recommended)
www to non-www (or vice versa) via the domain options. Vercel automatically handles SSL certificate provisioning once valid.Verify SSL and test
vercel certs ls. Test deployment: vercel httpstat / or visit the domain in browser. Ensure no errors in dashboard.Common Issues & Troubleshooting
Domain shows 'Invalid Configuration' or fails verification
Remove conflicting DNS records (e.g., multiple A records); ensure exact values from <code>vercel domains inspect</code> are used and wait for propagation.
Subdomain CNAME not verifying
Confirm CNAME name is just the subdomain (e.g., <code>www</code>, not <code>www.example.com</code>) and value matches Vercel-provided target exactly.
Propagation taking too long (over 1 hour)
Check global propagation with dig/@8.8.8.8 or online tools; clear registrar cache if available; avoid TTL changes during setup.
Domain assigned to another project or team
Use <code>vercel domains add example.com --force</code> to reassign, or add TXT verification record if prompted.
Wildcard or nameservers not working
Set registrar nameservers to Vercel's (<code>ns1.vercel-dns.com</code>, <code>ns2.vercel-dns.com</code>) and add custom records in Vercel DNS.