Add WWW to DNS — A/CNAME, Apex Rules & Provider Guides
Add a www hostname to your DNS in the browser. Steps: enter your domain, pick a record scheme (Apex A + www CNAME, dual A, or CDN host), copy the rows, then follow a provider guide (Cloudflare, Route 53, Vercel, and more). Example: example.com + 203.0.113.10 → A @ and CNAME www. Apex cannot be a bare CNAME — paste stays local; optional live lookup uses DoH.
| Type | Name / Host | Value / Target | TTL | Notes |
|---|
How it works
Enter the apex domain and optional server IPs. Choose a scheme, generate the table, copy into your DNS panel, then open a provider guide below for click-path steps. Optionally check live A/AAAA/CNAME via DNS-over-HTTPS. This tool never logs into your registrar.
Rules you should expect
What the records mean, why the apex cannot be a bare CNAME, and how that differs from an HTTP redirect.
- Recommended default: A/AAAA on @ (apex) plus CNAME www → yourapex.com. Many panels use Host=www and Value=example.com without a trailing dot.
- RFC 1034: a bare CNAME cannot sit on the zone apex because SOA/NS must live there. Use A/AAAA, or a provider ALIAS / CNAME flattening feature.
- DNS makes names resolve; it does not pick a canonical host. After both resolve, set a 301 (www↔apex) on the server or CDN and align TLS SANs.
- Privacy: record generation is local. “Check current DNS” asks this site’s Worker to query Cloudflare DoH for the hostname you typed — not an upload of your zone file.
Example
Domain example.com, IPv4 203.0.113.10, scheme Apex A + www CNAME → rows: A @ 203.0.113.10 and CNAME www example.com (TTL 3600). Then add them in your panel and optionally 301 apex→www (or the reverse).
Good fits
- Self-hosted site: apex already has an A record — add www as CNAME to the apex.
- CDN/PaaS (Vercel, Netlify, Cloudflare): www CNAME to the host they give you; apex via flattening/ALIAS or A.
- SEO cleanup: make both hostnames resolve, then choose one canonical with a 301.
Provider & scenario guides
Same task, different panels. Open your provider, follow the steps, and prefer official docs if the UI moved.
Generic DNS panel (registrars)
When: GoDaddy, Namecheap, or any classic DNS Management UI.
Suggested scheme: 1 — Apex A + www CNAME (or 2 if CNAME to apex is blocked).
Steps
- Open DNS Management / DNS Records for the domain.
- Add Record: Type A, Host @ or blank, Value = server IPv4.
- Add Record: Type CNAME, Host www, Value = yourapex.com (no http://).
- Save; wait for TTL/propagation.
- Optional: set HTTPS redirect www↔apex at the host.
Notes: Field names vary (Host vs Name). Do not put a CNAME on @.
Cloudflare DNS
When: DNS is hosted on Cloudflare.
Suggested scheme: 1, or 3 if pointing at another CDN hostname.
Steps
- Open the zone → DNS → Records.
- Add A/AAAA for @ to your origin (or use flattening later).
- Add CNAME for www targeting @ or the apex hostname.
- Decide Proxied (orange) vs DNS only (grey) per your TLS plan.
- Save and test both hostnames.
Notes: Cloudflare can flatten CNAMEs at the apex. Proxied changes how TLS and origin IPs work.
AWS Route 53
When: Hosted zone in Route 53, often with CloudFront/ELB.
Suggested scheme: 1 for simple IPs; apex often needs Alias A → CloudFront/ELB.
Steps
- Open Hosted zones → your domain → Create record.
- For www: Record type CNAME, value = apex (or CloudFront DNS name).
- For apex: prefer A–Alias to CloudFront/ELB — do not create a bare CNAME on the apex.
- Set routing policy Simple unless you need failover.
- Test with dig/nslookup after changes.
Notes: Alias records are AWS-specific and solve the apex CNAME problem.
Vercel
When: App hosted on Vercel; DNS may be external.
Suggested scheme: 3 — www CNAME to the target Vercel shows; apex per Vercel’s A/ALIAS instructions.
Steps
- Project → Settings → Domains → add example.com and www.example.com.
- Copy the CNAME/A values Vercel displays.
- In your DNS panel, create www CNAME to that target.
- Configure apex as Vercel instructs (A or ALIAS).
- Wait for Vercel to show Valid configuration.
Notes: Exact apex values can change — trust the Domains UI over outdated blog posts.
Netlify
When: Site on Netlify with custom domain.
Suggested scheme: 3 with Netlify’s load-balancer hostname, or Netlify DNS.
Steps
- Site configuration → Domain management → Add custom domain.
- Add www and apex as Netlify suggests.
- If DNS is external: CNAME www to the Netlify hostname shown.
- For apex use Netlify DNS, ALIAS, or A records from the docs.
- Enable HTTPS once DNS validates.
Notes: Netlify DNS can manage apex more easily than external A-only panels.
Alibaba Cloud DNS
When: 解析托管在阿里云「云解析 DNS」。
Suggested scheme: 1 — 主机记录 www 的 CNAME;@ 的 A 记录。
Steps
- 打开云解析 DNS → 域名解析 → 解析设置。
- 添加记录:主机记录 @,类型 A,记录值 = 服务器 IP。
- 添加记录:主机记录 www,类型 CNAME,记录值 = 主域名或 CDN 目标。
- TTL 可先用 10 分钟便于验证。
- 保存后用查询工具确认生效。
Notes: 「主机记录」填 www 或 @,不要把完整 FQDN 填进主机记录(除非文档要求)。
Self-hosted VPS (Nginx / Caddy)
When: You control the web server after DNS is set.
Suggested scheme: 1 first, then HTTP 301 on the server.
Steps
- Publish scheme-1 DNS records and wait until both hostnames resolve.
- In Nginx/Caddy, listen for both server names.
- Add a 301 from the non-canonical host to the canonical one.
- Issue/renew TLS with SANs for both names.
- Verify with curl -I on http and https.
Notes: DNS alone never redirects browsers; the 301 lives on the app or edge.
This tool does not change your DNS zone. Panel menus change — when in doubt, follow the official link under each guide.
Frequently asked questions
Can the apex (naked domain) be a CNAME?
Not as a bare CNAME in standard DNS — it conflicts with SOA/NS. Use A/AAAA, or your provider’s ALIAS / CNAME flattening.
Should I use CNAME or A for www?
Prefer CNAME www → apex when both should follow the same IPs. Use dual A/AAAA if your panel cannot CNAME to the same zone. Use CDN hostname when the host gives you a target like cname.vercel-dns.com.
DNS works — why do I still need a 301?
Resolving both names is not the same as choosing a canonical URL. Search and cookies need one preferred host via HTTP redirect.
What should I watch on Cloudflare “Proxied” (orange cloud)?
Proxied hides origin IPs and terminates TLS at Cloudflare. Ensure the certificate covers www and apex, and that origin server names match what you expect.
Does checking DNS upload my zone?
No. Generation stays in the tab. Lookup only queries public DNS for the hostname you enter via DoH.
Questions or feedback
Something unclear, broken, or missing? Draft a message below — we read every note about these tools.