Add a custom domain to my Vercel project

careful intermediate #domain#dns#https#cname

When to use this: You own a domain (like example.com) and want the site served from it instead of *.vercel.app.

Be careful with this one. DNS changes can briefly take the domain offline. Do it when a short interruption is acceptable.

Before you start

Steps

  1. Add the domain in Vercel

    Project, Settings, Domains, enter example.com, click Add. Vercel also offers www.example.com and a redirect between them.

  2. Copy the DNS records Vercel shows

    Vercel displays exactly which record to create (an A record for the root domain, a CNAME for www). Use the values shown in YOUR dashboard, because they can differ per project.

  3. Create the records at your DNS provider

    Add the record(s) exactly as shown. Remove conflicting old A/CNAME records for the same name. Alternatively point your nameservers to Vercel and let it manage DNS.

  4. Wait for verification

    terminal
    vercel domains inspect example.com

    Propagation takes minutes, sometimes a few hours. The dashboard shows 'Valid Configuration' when done. HTTPS certificates are issued automatically.

How to verify it worked

  • Opening https://example.com shows the site with a valid padlock.

How to undo it

Remove the domain in Settings, Domains, then restore the old DNS records at your provider.

Common errors and fixes

'Invalid Configuration' stays red The record is wrong, missing, or an old conflicting one exists. Compare with the dashboard values and check using an online DNS lookup.
Certificate error Wait for DNS to finish propagating. Check there is no CAA record blocking Let's Encrypt.

Q&A

Why do I need both an A record and a CNAME?

The bare domain (example.com) cannot be a CNAME at most providers, so it uses an A record. Subdomains like www use a CNAME.

Who provides the HTTPS certificate?

Vercel issues and renews it automatically once DNS points to the project.

Practice these as flashcards →

Terms in this scenario

Related scenarios

My notes

Saved in this browser only.