Setting up a custom domain
Use this guide to add a custom domain to your Vercel project, configure DNS records, and verify that everything is working.
This guide requires a linked Vercel project. Run
vercel link in your project directory if you haven't already.
Use this block when you already know what you're doing and want the full command sequence. Use the steps below for context and checks.
# 1. Check your existing domains
vercel domains ls
# 2. Add the domain to your project
vercel domains add example.com my-project
# 3. Check what DNS records are needed
vercel domains inspect example.com
# 4. Configure DNS records (apex domain)
vercel dns add example.com '@' A 76.76.21.21
# 4b. OR configure DNS records (subdomain)
vercel dns add example.com www CNAME cname.vercel-dns-0.com
# 5. Verify DNS configuration
vercel domains inspect example.com
# 6. Verify SSL certificate was provisioned
vercel certs ls
# 7. Test the domain
vercel httpstat /
vercel curl /List the domains already configured on your team to avoid conflicts:
vercel domains lsThis shows all domains across your projects, including their DNS status and verification state.
Add your custom domain and associate it with your project:
vercel domains add example.com my-projectIf the domain is already assigned to another project in your team, use the --force flag to reassign it:
vercel domains add example.com my-project --forceFor a www subdomain, add that separately:
vercel domains add www.example.com my-projectIf you add both example.com and www.example.com, configure a redirect from one to the other in your Vercel project settings to avoid duplicate content.
After adding the domain, inspect it to see the required DNS configuration:
vercel domains inspect example.comThis shows the current DNS verification status and the exact records you need to configure. The output tells you whether the domain needs an A record, CNAME record, or nameserver delegation.
The records you add depend on whether you're configuring an apex domain (like example.com) or a subdomain (like www.example.com).
For an apex domain, add an A record:
vercel dns add example.com '@' A 76.76.21.21For a subdomain, add a CNAME record:
vercel dns add example.com www CNAME cname.vercel-dns-0.comThe DNS values shown above (76.76.21.21 and cname.vercel-dns-0.com) are
Vercel's general-purpose values. Your project may have specific values. Run
vercel domains inspect example.com to see the exact records recommended for
your domain. These commands work when your domain's nameservers are pointed to
Vercel. If you manage DNS with an external provider, add these records through
your provider's dashboard instead.
To verify your DNS records were added:
vercel dns lsRun inspect again to check that the domain is properly configured and verified:
vercel domains inspect example.comDNS propagation can take a few minutes. If the domain isn't verified yet, wait and run the command again.
Vercel automatically provisions an SSL certificate after DNS verification succeeds. Check that the certificate was issued:
vercel certs lsLook for your domain in the output. The certificate typically provisions within a few minutes of DNS verification.
Verify your domain is serving traffic correctly:
vercel httpstat /This shows a full timing breakdown for a request to your production deployment. If you need to check the response body:
vercel curl /If your domain's nameservers point to an external DNS provider (like Cloudflare or Route 53), you can't use vercel dns add to configure records. Instead:
- Add the domain to your project with
vercel domains add - Run
vercel domains inspectto see the required records - Add those records through your external DNS provider's interface
- Run
vercel domains inspectagain to verify Vercel detected the records
Was this helpful?