The Vercel DNS Situation
If you have ever added a custom domain to a Vercel project, you have run into the vercel apex domain problem. Vercel hands you a friendly setup screen that asks you to add either a CNAME for www or an A record for the vercel root domain. The recommended path is the CNAME, because cname.vercel-dns.com resolves to whichever edge node is closest to your visitor and gets updated automatically as Vercel grows its network.
The complication is that DNS does not allow a CNAME record at the apex (also called the zone apex, naked domain, or root domain). RFC 1034 forbids a CNAME at any name that also has SOA and NS records, which is exactly what your apex has. So Vercel suggests an alternative: a plain A record pointing to 76.76.21.21, their Anycast IP for apex domains.
That works, but it has trade-offs:
- It bypasses CNAME-based routing. The CNAME flow lets Vercel return different IPs per request based on geography, network, and load. The single A record at
76.76.21.21is a more static entry point and may not always pick the optimal edge. - No native IPv6 path on apex. Vercel does not publish a matching AAAA address for the apex Anycast endpoint, so IPv6 visitors hitting your naked domain may fall back to IPv4 or fail entirely depending on their resolver.
- Edge Functions and middleware behave inconsistently on apex. Some advanced features in the Vercel platform — including certain Edge Function configurations, custom middleware behavior, and ISR cache invalidation — assume the CNAME-based setup. Putting your traffic on the apex A record can produce subtle differences from your
wwwbehavior. - You end up serving two URLs. Without an explicit redirect, both
yourdomain.comandwww.yourdomain.commay render your app, splitting analytics, dropping cookies twice, and creating duplicate-content headaches for SEO.
The cleaner approach is to put your real site on www.yourdomain.com via the recommended CNAME and use a tiny redirect service for the apex. That is what ApexToWWW does — and it is a drop-in 76.76.21.21 alternative that gives you proper IPv6, a real 301, and clean separation.
Step-by-Step: Vercel + ApexToWWW
Here is the full vercel naked domain redirect setup, end to end. It assumes you already have a Vercel project deployed.
- Step 1 — Add www in Vercel. In the Vercel dashboard, open your project, then go to Settings → Domains and add
www.yourdomain.com. Vercel will display the DNS records you need to add at your registrar. - Step 2 — Add the www CNAME at your DNS provider. Vercel will tell you to add a CNAME record: host
www, valuecname.vercel-dns.com. Save it. This is the vercel custom domain www entry that does the real work. - Step 3 — Add the apex A record (ApexToWWW). Add a new A record: host
@(or leave blank), value65.21.184.101. Remove any existing A record on@first, including any old76.76.21.21entry from a previous Vercel setup. - Step 4 — Add the apex AAAA record (ApexToWWW). Add an AAAA record: host
@, value2a01:4f9:c012:a304::1. This gives IPv6 visitors a clean redirect path that the Vercel apex IP cannot offer. - Step 5 — Mark www as primary in Vercel. Back in the Vercel Domains panel, find
www.yourdomain.comand set it as the primary domain. This makes Vercel canonicalize internal links and the ISR cache to the www hostname. - Step 6 — Verify. Wait a few minutes for DNS to propagate, then run
curl -I https://yourdomain.com. You should seeHTTP/2 301andlocation: https://www.yourdomain.com/. Visithttps://yourdomain.com/some/path?q=1in a browser and confirm you land on the same path under www.
DNS Records for Vercel + ApexToWWW
| Type | Name / Host | Value | Purpose |
|---|---|---|---|
CNAME |
www |
cname.vercel-dns.com |
Vercel app |
A |
@ |
65.21.184.101 |
ApexToWWW (IPv4) |
AAAA |
@ |
2a01:4f9:c012:a304::1 |
ApexToWWW (IPv6) |
Vercel Apex Alternatives Compared
If you are deciding between Vercel’s built-in apex A record and a redirect service, this is the trade-off:
| Method | CNAME used | IPv6 | CDN optimized |
|---|---|---|---|
Vercel A record (76.76.21.21) |
No | No | Partial |
| ApexToWWW redirect | For www only | Yes | Yes |
The redirect path is what most production Vercel sites end up doing once they outgrow the quick-start A record.
Works With Other Platforms Too
The same two records work for any host that prefers a CNAME on www. If you are not on Vercel, see the platform-specific guides:
- Heroku apex domain redirect — Heroku DNS targets need a CNAME, exactly like Vercel.
- Netlify apex domain redirect — an alternative to Netlify’s load-balancer A record.
- GitHub Pages apex domain redirect — for users who want a single canonical www URL.
Vercel-Specific FAQ
Does this work with Vercel Edge Functions?
Yes. All your real traffic continues to hit Vercel through the www CNAME, which is the canonical setup that Edge Functions, middleware, and Edge Config all expect. ApexToWWW only handles the bare-domain hit and immediately 301s to www, where Vercel takes over and runs your edge logic exactly as designed.
Can I still use Vercel Analytics?
Yes. Vercel Analytics, Speed Insights, and Web Analytics all attach to the project, not the hostname. Once www.yourdomain.com is set as primary in Vercel and traffic redirects there, every analytics event is recorded normally. There is no double-counting from the apex hit because the redirect happens at the network layer before any page renders.
What about preview deployments?
Untouched. Preview deployments use Vercel-generated subdomains (your-project-git-branch.vercel.app) and never resolve through your apex. ApexToWWW only sees requests to your registered apex domain, so preview URLs, branch deployments, and the production *.vercel.app URL all keep working as before.
Does it preserve Vercel’s SSL?
Yes, on both ends. Vercel continues to issue and renew its own Let’s Encrypt certificate for www.yourdomain.com. ApexToWWW issues a separate Let’s Encrypt certificate for yourdomain.com automatically on first request, so HTTPS works on the apex too — and after the 301 the browser is on Vercel’s certificate. No mixed-content warnings, no manual cert management.
Ship Your Vercel Apex Redirect in 2 Minutes
Two DNS records. No signup. Free forever. Works with Vercel’s CNAME setup out of the box.
Get StartedQuestions? Email [email protected]