Build and Launch a Website with AI
How to Add a Custom Domain to Vercel and Fix Invalid Configuration
Point your apex and www to an existing Vercel deployment. Check the records your project expects, then confirm HTTPS and redirects from the public internet.

If your production vercel.app URL already works, open Settings → Domains in the Vercel project, add your domain, and copy the DNS records Vercel shows into the provider that serves your DNS. An apex domain such as example.com normally takes an A record. A subdomain such as www.example.com normally takes a CNAME. If Vercel shows Invalid Configuration, compare the live DNS replies with the project’s values before touching the build. Vercel’s custom domain setup
Open the Production deployment and check its home page and a known deep link. Pick a recognizable line of copy you can look for after switching URLs. If the default URL already shows a blank page or a route fails on refresh, fix the React and Vite deployment on Vercel first.
Under Settings → Domains → Add Domain, enter the hostname, such as example.com. Add www.example.com separately if visitors should be able to use both. Choose a primary production address and configure the other hostname to redirect to it in Vercel. For example, if your business cards show example.com, connect the apex to Production and redirect www to the apex. Each hostname needs its own working DNS and HTTPS even if one serves only a redirect. The browser validates the certificate before receiving a redirect over HTTPS.
Check dig example.com NS +short to identify the nameservers. If you registered the domain at a registrar and use Cloudflare nameservers, the records belong in the Cloudflare zone. For a site that already has visitors, save the existing website records and redirect rules first. Keep the mail records in place, including your MX records and the TXT records used for SPF and DMARC, as well as any DKIM records.
| Address you want to connect | Type | Name or host | Value |
|---|---|---|---|
example.com | A | @ or your provider’s apex convention | The IPv4 address shown for your Vercel project |
www.example.com | CNAME | www | The target hostname shown for this subdomain |
demo.example.com | CNAME | demo | The target shown for the demo subdomain |
Use the current values under Domains. A CNAME target is a hostname and the trailing dot in a fully qualified name matters for providers that otherwise append the zone name. Query the saved record to catch accidental suffixes. If Vercel also requests proof of ownership, publish the TXT record it specifies and choose Verify. Then check the A or CNAME record for website traffic as its own step. Vercel’s DNS and ownership troubleshooting
Replace example.com in these commands. If you prefer a browser, use Google Public DNS to check the same record types individually.
dig example.com NS +short
dig example.com A +noall +answer
dig example.com AAAA +noall +answer
dig www.example.com CNAME +noall +answer
dig www.example.com A +noall +answer
| What you observe | What to check |
|---|---|
| The control panel shows your changes, but the internet still returns the old values | Compare the zone you edited with the nameservers in the NS lookup. Query one authoritative nameserver directly. If that answer is current, give recursive resolvers time to expire the old TTL. |
| Some visits still reach the previous site, or the failure depends on the network | Look for stale A or AAAA records at the affected hostname. Identify which entries belonged to the old website before updating them. |
Only www fails | Confirm you added it to the same project. Verify its CNAME, then check whether it serves Production or redirects to the primary hostname. |
| Public DNS shows Cloudflare proxy addresses and Vercel flags the record | For a site that will receive traffic directly on Vercel, set the affected Cloudflare record to DNS only and recheck. If the site depends on a front-end proxy, review the certificate validation paths and caching requirements before switching. |
Changing proxy mode changes where requests go. For an existing public site, check which Cloudflare access controls, cache rules, and redirects the hostname relies on first. Vercel’s guide to external proxies
Vercel automatically provisions a certificate after DNS verification. If DNS checks out and HTTPS still errors, confirm the exact hostname is attached to the project and check whether a proxy is interrupting certificate validation. If there is an applicable CAA policy, make sure it authorizes the issuer specified by Vercel. Vercel’s SSL documentation · Certificate troubleshooting
Replace the hostname and /about with a domain and a public route from your site. These GET requests display the response headers at each hop and keep certificate verification enabled.
curl -sS -L --max-redirs 5 -D - -o /dev/null 'http://example.com/'
curl -sS -L --max-redirs 5 -D - -o /dev/null 'https://www.example.com/about?ref=domain-check'
Check the Location headers for the path and query string, then expect a 200 on the final public page at your primary HTTPS hostname. If the chain cycles between www and the apex, check redirect settings in the application, Vercel, and the proxy, and set one direction. Open the primary URL in a private browser window or on mobile data and verify the copy you noted earlier. Test key features such as sign-in or form submission on the real hostname. Update any OAuth callback URLs and the site address you verify in Search Console where applicable.
Live reference check, December 5, 2026. Google Public DNS returned an A record for nextjs.org and a Vercel DNS CNAME for www.nextjs.org. A GET to the public Next.js documentation went from HTTP to HTTPS with 308 → 200. Its HTTPS www address returned 307 → 200, preserving /docs?ref=domain-check. These were read-only checks of public responses. The dashboard steps and certificate behavior follow Vercel’s documentation. Copy DNS values from your own project.
Hobby can connect a domain you already own for a personal, non-commercial project. Domain registration and renewal are costs charged separately by the registrar. For commercial work, check Vercel’s plan terms and budget for hosting as well. On December 5, 2026, Vercel listed Pro at US$20 per month before taxes, additional usage, and paid extras. Hobby plan terms · Vercel pricing
Next step: compare the actual plans
Filter the listed plans by budget, specifications and region, or start with a buying guide.