What is an apex domain?
An apex domain, also called a root, naked or bare domain, is a domain name with no prefix in front of it: example.com, not www.example.com. DNS does not allow a CNAME record at the apex, so most hosts cannot serve it directly. A redirect to www solves that.
Set it up in three steps
Your www record stays at your host. ApexToWWW only takes over the apex.
-
Add the A record
At your DNS provider, create an A record for @ (the apex).
A @ 65.21.184.101 -
Add the AAAA record
Add an AAAA record for @ so IPv6 visitors get the same redirect.
AAAA @ 2a01:4f9:c012:a304::1 -
Test the 301
After DNS propagates (typically 5 to 30 minutes), check the response.
curl -I http://yourdomain.com
Remove any existing A or AAAA records on @ first. Keep your www CNAME pointing at your host. Not sure how your host handles www? Pick your provider below →
Guides for your hosting provider
The same two records work wherever www is a CNAME. Each guide covers that platform's specifics.
Cloudflare Pages
CNAME flattening if Cloudflare is your DNS. ApexToWWW if it is not.
Apex redirect guide →Vercel
Point www at cname.vercel-dns.com and redirect the apex. No 76.76.21.21 needed.
Apex redirect guide →Netlify
Works with Netlify DNS or any external DNS provider.
Apex redirect guide →GitHub Pages
A CNAME file and www on GitHub, the apex redirect with two records.
Apex redirect guide →Heroku
Heroku needs a www subdomain. Fix the naked domain.
Apex redirect guide →Firebase Hosting
Skip the IPv4-only apex A records. Get IPv6 and HTTP/3 on the apex.
Apex redirect guide →Render
No ALIAS or ANAME support needed at your DNS provider.
Apex redirect guide →AWS Amplify
No Route 53 migration required.
Apex redirect guide →Other direction?
ApexToWWW only redirects apex to www. To redirect www to apex, use your host's native methods.
Redirect www to apex →ApexToWWW at a glance
The values and behaviour, in one place.
- Service
- Apex domain to www, HTTP 301
- Price
- Free, no signup, no usage limits
- Setup
- 2 DNS records (1 A, 1 AAAA)
- A record (IPv4)
- 65.21.184.101
- AAAA record (IPv6)
- 2a01:4f9:c012:a304::1
- Redirect
- 301 permanent. Path and query string preserved.
- SSL/TLS
- Let's Encrypt, issued on first request, renewed automatically
- Protocols
- HTTP/1.1, HTTP/2, HTTP/3 (QUIC). IPv4 and IPv6.
- DNS propagation
- Typically 5 to 30 minutes, up to 48 hours
- Works with
- GitHub Pages, Vercel, Netlify, Cloudflare Pages, Heroku, Firebase Hosting, Render, AWS Amplify, and any host where www is a CNAME
- Not supported
- Wildcard domains. Redirecting www to apex.
- Operator
- Sandbox.ventures, Aarhus, Denmark
In one sentence: ApexToWWW is a free DNS-based service that 301-redirects an apex (naked) domain to its www subdomain. You add one A record (65.21.184.101) and one AAAA record (2a01:4f9:c012:a304::1) at the apex, and every request is answered with a 301 to the matching https://www URL, over an automatically renewed Let's Encrypt certificate.
Why a redirect, and not ALIAS or CNAME flattening?
ALIAS, ANAME and CNAME flattening serve your site on the apex directly, but only some DNS providers offer them. A redirect works with every provider and keeps your real traffic on www.
| Criterion | ApexToWWW redirect | ALIAS / ANAME / flattening | Registrar forwarding |
|---|---|---|---|
| Works on any DNS provider | Yes | Only some providers | Yes |
| Real 301 over HTTPS | Yes | Not a redirect: the apex serves the site | Varies. Check with curl -I. |
| Apex serves the site itself | No, it redirects to www | Yes | No |
| Cost | Free | Depends on the provider | Often free |
If you want the apex itself to serve your site and your DNS provider supports ALIAS or ANAME, use that instead. Compare all five methods →
Guides
Background on apex domains, DNS and canonical URLs.
How to redirect your apex domain to www
Step by step, with instructions for Cloudflare, GoDaddy, Namecheap and more.
Read the guide →What is an apex domain?
Root, bare, naked, zone apex: how DNS hierarchy works and why the apex cannot take a CNAME.
Read the guide →Apex domain vs www
Technical differences, CDN compatibility, and which one to make canonical.
Read the guide →Apex domain redirect: 5 methods compared
DNS service, Cloudflare Redirect Rules, ALIAS/ANAME, registrar forwarding or nginx.
Read the guide →Redirect www to apex
The reverse direction: native methods for Cloudflare, Vercel, Netlify and any host.
Read the guide →Hreflang and canonical tags
How rel=canonical and hreflang work, and why they conflict when misconfigured.
Read the guide →Frequently asked questions
What is an apex domain, and why does it need a redirect?
An apex domain (also called a root, naked, or bare domain) is your domain without any prefix: example.com rather than www.example.com. DNS does not allow a CNAME record at the apex (RFC 1034), so it cannot point at most hosts and CDNs, such as GitHub Pages, Netlify and Vercel. A redirect sends apex visitors to your www subdomain, where your site lives.
How do I redirect my apex domain to www with ApexToWWW?
Add an A record for @ pointing to 65.21.184.101 and an AAAA record for @ pointing to 2a01:4f9:c012:a304::1. There is nothing to sign up for or configure. DNS changes typically propagate within 5 to 30 minutes.
Do I need my own SSL certificate?
No. ApexToWWW issues a Let's Encrypt certificate for your apex domain on the first HTTPS request and renews it automatically. Your www site keeps the certificate from your own host.
Is ApexToWWW really free?
Yes. There is no account, no usage limit and no paid tier today. It runs on small ARM64 servers, which keeps costs low.
Does the redirect keep the URL path and query string?
Yes. example.com/pricing?plan=pro redirects to www.example.com/pricing?plan=pro. It is a 301 (permanent) redirect, so search engines treat the www URL as the canonical address.
Which hosting providers does it work with?
Any host where www is a CNAME, including GitHub Pages, Netlify, Vercel, Cloudflare Pages, Heroku, Firebase Hosting, Render and AWS Amplify. Keep your www record pointing at your host. ApexToWWW only handles the apex.
Does ApexToWWW redirect www to the apex instead?
No. It only redirects the apex to www. To go the other way, use your host's own redirect feature. Our guide to redirecting www to apex covers Cloudflare, Vercel, Netlify and other hosts.
Will the redirect affect my SEO?
A 301 tells search engines that www is the canonical address, which consolidates ranking signals on one URL. Keep a canonical tag on each page pointing at the same www URL, and list only www URLs in your sitemap.
Are wildcard domains supported?
No. The free service only redirects domains whose A and AAAA records point directly at its servers. That is verified before a certificate is issued. Wildcard domains are not supported.
Two records. That is the whole setup.
A 65.21.184.101 and AAAA 2a01:4f9:c012:a304::1, both on @. Free, no account.