Pick one primary name, then make the other redirect
Visitors type both yourdomain.com and www.yourdomain.com. Both must resolve, and one should send a permanent redirect to the other so search engines, analytics and SSL certificates see one canonical address. The hosting platform usually performs that redirect for you once both names point at it, which is why the DNS step matters more than any redirect setting.
Vercel's guidance is explicit: setting www as the primary domain, with the apex redirecting to it, gives it flexibility to adjust traffic steering for routing and DDoS mitigation, which a fixed apex A record cannot. [7] Netlify recommends using a subdomain as your primary domain when DNS is hosted elsewhere, because apex domains cannot use direct DNS routing on its CDN. [5] GitHub Pages creates redirects between the apex and www names once both records are configured. [4]
Why the apex cannot be a CNAME
The rule dates back to the core DNS specification. RFC 1034, section 3.6.2, says: if a CNAME RR is present at a node, no other data should be present. [1] Your root domain always carries other data: the SOA and NS records that make it a zone, plus MX records if you receive email and TXT records for SPF and site verification. So a CNAME at the root would break the rule.
Subdomains do not have that problem. Nothing else needs to live at www, so www can be a CNAME pointing at your host. Vercel puts it plainly: apex domains cannot use a CNAME, but subdomains like www can. [7]
Your three options for the apex at Namecheap
Namecheap's DNS gives you three ways to make the bare domain do something. Each one conflicts with the others on the same host, so remove the old record before adding the new one. [2] [3]
| Option | How it works | Use it when | Watch out for |
|---|---|---|---|
| A (and AAAA) records | Point @ at fixed IP addresses the host publishes | The host gives IPs (GitHub Pages, Vercel, Netlify fallback) | IPs can change; copy them from the host's current page, not an old tutorial [7] |
| ALIAS record | Points @ at a hostname; Namecheap resolves it to A/AAAA at request time; TTL 1 or 5 minutes [2] | The host gives a hostname for the apex (Netlify's load balancer, GitHub's username.github.io) | Remove CNAME, URL redirect, A and AAAA records on @ first [2] |
| URL Redirect record | Namecheap answers for @ and sends visitors to another URL: 301 permanent, 302 unmasked or masked frame [3] | You only want the apex to bounce to www and the host handles www | HTTPS redirects only work to a different destination domain [3] |
Setup table: what GitHub Pages, Netlify and Vercel ask for
These are the values each host documented on the date above. Always prefer the values your own dashboard shows, especially on Vercel and Netlify, which can assign project-specific targets. [4] [5] [6] [7]
| Host | Apex (@) record | www record | Redirect and HTTPS notes |
|---|---|---|---|
| GitHub Pages | A records to 185.199.108.153, 185.199.109.153, 185.199.110.153 and 185.199.111.153 (AAAA optional), or ALIAS to USERNAME.github.io [4] | CNAME to USERNAME.github.io or ORGANIZATION.github.io, without the repository name [4] | GitHub creates redirects between apex and www when both are configured; Enforce HTTPS can take up to 24 hours to appear [4] |
| Netlify | ALIAS, ANAME or flattened CNAME to apex-loadbalancer.netlify.com; if unsupported, A record to 75.2.60.5 [5] | CNAME to your-site.netlify.app [5] | Adding the apex or www adds both; configure both records; propagation can take up to a day [5] |
| Vercel | A record to the value on your project's domain card; 76.76.21.21 for most projects, newer projects may get another address [7] | CNAME to the target on your domain card; each project has a unique CNAME [6] [7] | Vercel prompts you to add www when you add an apex; add both names and configure a redirect to your preferred one [6] |
Do not break email while fixing the website
Website records and mail records share the apex. Changing the A or ALIAS record at @ does not touch MX records, but replacing nameservers does. Vercel warns that before changing nameservers you should copy existing records, including MX records for email and any verification TXT records, and notes that changing only the website's A or CNAME record at your current DNS provider does not require moving the rest. [6]
Two smaller traps: Namecheap adds a hidden A record pointing at its forwarding server while a URL redirect is active, so a redirect and an A record for a host cannot both sit on @. [3] And Vercel lists a CAA record that does not permit Let's Encrypt as a cause of stuck certificate issuance. [7]
Checklist for a clean setup
- Decide the primary name first: www if your host recommends it (Vercel, Netlify with external DNS), otherwise follow the host's default. [5] [7]
- Delete conflicting records on @ (old A, AAAA, URL redirect, parking) before adding the new apex record. [2] [3]
- Add the www CNAME exactly as the host shows it, without the repository or project path. [4]
- Add the apex record: host IPs as A records, or an ALIAS to the host's hostname. [2] [4] [5]
- Add both names in the host's dashboard so it can issue certificates and redirect one to the other. [5] [6]
- Check both URLs over HTTPS after the propagation window: up to 30 minutes for a Namecheap URL redirect, up to 24 hours for other DNS changes. [3] [4]
- Confirm MX and TXT records are untouched and send a test email. [6]
Questions before you decide
Why can't I add a CNAME for my root domain?
RFC 1034 says that if a CNAME record is present at a node, no other data should be present. The root of your domain must hold other records, such as MX for email, so a plain CNAME cannot live there.
What is an ALIAS record at Namecheap?
Namecheap describes ALIAS (also called ANAME) as a record that points one name to another like a CNAME but can coexist with other records and can be used on the root. It resolves to the target's A and AAAA records at request time, and works on BasicDNS, FreeDNS and PremiumDNS.
Can Namecheap redirect http to https on my own domain?
Namecheap's redirect article says redirecting over HTTPS is only possible to a different destination domain. Same-domain HTTP to HTTPS redirects need an .htaccess file or the Namecheap SSL plugin in cPanel.
Should www or the root be my primary address?
Vercel recommends making www primary with the apex redirecting to it, because a CNAME lets Vercel steer traffic while an apex A record is fixed. Netlify recommends a subdomain as primary when you use external DNS. Either works if one redirects to the other.
How long do these changes take?
Namecheap says URL redirect changes generally take up to 30 minutes to be accepted globally. GitHub says DNS changes can take up to 24 hours and Enforce HTTPS can take up to 24 hours to become available. Netlify gives several hours up to a full day.
Sources & verification
Product details and prices can change. Check the linked provider before buying.
- RFC 1034: Domain names - concepts and facilities (section 3.6.2) Accessed 30 Oct 2026
- Namecheap Knowledgebase: How to create an ALIAS record Accessed 30 Oct 2026
- Namecheap Knowledgebase: How to set up a URL redirect for a domain Accessed 30 Oct 2026
- GitHub Docs: Managing a custom domain for your GitHub Pages site Accessed 30 Oct 2026
- Netlify Docs: Configure external DNS for a custom domain Accessed 30 Oct 2026
- Vercel Docs: Adding and configuring a custom domain Accessed 30 Oct 2026
- Vercel Knowledge Base: Can I use my domain on Vercel with A records? Accessed 30 Oct 2026
Sources link directly to providers. Product buttons may use separately labeled affiliate links. Read our disclosure.
