Root Domain vs WWW: A Records, CNAME and Redirect Strategy
Learn the difference between root domain and www, which DNS records to use, how redirects should work, and how to avoid SSL and duplicate-content issues.
Introduction
The root domain and www version of a domain are different hostnames. For example, example.com and www.example.com can have different DNS records, different SSL behavior and different redirect rules.
A clean setup usually chooses one preferred version and redirects the other version to it. This helps avoid confusing users, search engines and analytics tools. The DNS records must point both hostnames to the correct destination, and the website or hosting platform must be configured to serve or redirect both versions correctly.
Quick answer
The root domain is the main domain, such as example.com. The www version is a subdomain, such as www.example.com. Both should be configured intentionally. Usually, the root domain uses an A/AAAA record or ALIAS/ANAME, while www often uses a CNAME or A record. One version should redirect to the other as the canonical website address.
Root domain vs www
The root domain is the main domain without a subdomain.
example.com
The www version is a subdomain.
www.example.com
These two hostnames can point to the same website, different servers, or one can redirect to the other. They do not automatically behave the same unless DNS and hosting are configured that way.
Which version should be primary?
Both root and www can work as the main website address. The important part is consistency.
Root primary
- example.com is the main version
- www.example.com redirects to example.com
https://example.com
WWW primary
- www.example.com is the main version
- example.com redirects to www.example.com
https://www.example.com
There is no universal best choice. Choose one version and use it consistently in redirects, internal links, canonical tags, analytics and marketing materials.
DNS records for root and www
Root domain
- Common records: A, AAAA, ALIAS or ANAME
- The root domain usually cannot use a normal CNAME at many DNS providers
example.com → 192.0.2.10
WWW
- Common records: CNAME, A or AAAA
- www is often configured as a CNAME, but an A record can also work
www.example.com → example.com
The DNS record only controls where the hostname points. Redirect behavior is handled by the web server, CDN, hosting platform or application.
Common setup patterns
Pattern 1: Root primary
DNS: example.com A 192.0.2.10, www.example.com CNAME example.com. Redirect: www → root.
Pattern 2: WWW primary
DNS: example.com A 192.0.2.10, www.example.com CNAME hosting-provider.example. Redirect: root → www.
Pattern 3: CDN or website builder
DNS: root uses A/AAAA, ALIAS/ANAME or provider-specific setup; www uses CNAME to provider hostname. Redirect configured inside CDN, hosting or website platform.
Always follow your hosting, CDN or website platform’s exact DNS instructions.
Why this matters
Root and www configuration matters because both hostnames may be used by visitors, search engines, links, ads and email signatures. If one version is missing, users may see errors. If both versions load separately without redirects, analytics and SEO signals can become fragmented.
DNS, SSL and redirects must all agree. It is possible for DNS to be correct while SSL or redirects are still misconfigured.
How to check root and www
Use DNS Lookup to check both the root domain and www hostname.
When checking root vs www, review
These five areas help confirm DNS, SSL and redirects work together.
Root domain DNS
Check A, AAAA, ALIAS/ANAME or provider-specific setup for example.com.
WWW DNS
Check whether www.example.com has a CNAME, A or AAAA record.
SSL coverage
Confirm the SSL certificate covers both example.com and www.example.com.
Redirect behavior
Check whether one version redirects to the preferred version.
Final URL
Confirm the final URL is the version you want users and search engines to use.
Check root and www DNS
Use DNS Lookup to inspect DNS records for both the root domain and www hostname.
Common problems
Root domain works but www does not
MediumThe root domain has DNS records, but www is missing or points to the wrong destination.
Next step: Add a CNAME or A record for www based on your provider’s instructions.
WWW works but root domain does not
MediumThe www hostname is configured, but the root domain has no valid A/AAAA, ALIAS or ANAME setup.
Next step: Configure the root domain according to your hosting or DNS provider.
Both versions load without redirect
Mediumexample.com and www.example.com both show the website, but neither redirects to the preferred version.
Next step: Choose a canonical version and configure a 301 redirect.
SSL works on one version only
HighThe SSL certificate may cover only root or only www.
Next step: Issue or configure SSL for both hostnames.
Redirect loop between root and www
HighHosting, CDN or application rules may redirect root to www and www back to root.
Next step: Review redirect rules in hosting, CDN and application settings.
Root domain cannot use CNAME
MediumMany DNS providers do not allow a normal CNAME at the root domain.
Next step: Use A/AAAA records, ALIAS/ANAME or provider-supported CNAME flattening.
DNS points correctly but website still fails
MediumThe destination server or platform may not be configured to accept the hostname.
Next step: Add both root and www inside the hosting, CDN or website platform.
How to configure it
-
Choose the preferred version
Decide whether users should end up on example.com or www.example.com.
-
Configure root DNS
Add the root domain records required by your provider, usually A/AAAA records or ALIAS/ANAME if supported.
-
Configure www DNS
Add a CNAME or A record for www based on your provider’s instructions.
-
Add both hostnames to the hosting platform
Make sure the web server, CDN, website builder or hosting panel recognizes both root and www.
-
Configure SSL for both versions
The certificate should cover example.com and www.example.com.
-
Set one canonical redirect
Redirect the non-preferred version to the preferred version with a clean 301 redirect.
-
Verify final behavior
Test both URLs and confirm they end on the same final website address.
Root and www examples
Root domain with A record:
example.com. 300 IN A 192.0.2.10
WWW as CNAME:
www.example.com. 300 IN CNAME example.com.
Alternative WWW as A record:
www.example.com. 300 IN A 192.0.2.10
dig example.com A
dig www.example.com A
dig www.example.com CNAME
These are examples only. Replace hostnames and IP addresses with values from your hosting, CDN or website platform.
Root, www and SSL
SSL certificates must cover the hostnames visitors use. If users can visit both example.com and www.example.com, the SSL certificate should cover both.
Common SSL problems:
- certificate covers root but not www
- certificate covers www but not root
- CDN SSL differs from origin server SSL
- redirect sends users to a hostname not covered by the certificate
Use SSL Checker after DNS and redirects are configured.
Root, www and SEO
Search engines can understand both root and www, but the site should be consistent. Use one preferred version and redirect the other version to it.
Best practices:
- use one canonical version
- use 301 redirects
- keep internal links consistent
- make sitemap URLs use the preferred version
- make canonical tags use the preferred version
- avoid both versions serving separate copies of the same page
Frequently asked questions
Is www required?
No. A website can use either the root domain or www as the main version.
Is www a subdomain?
Yes. www.example.com is a subdomain of example.com.
Should root redirect to www or www redirect to root?
Either is fine. Choose one preferred version and use it consistently.
Can the root domain use a CNAME?
Many DNS providers do not allow a normal CNAME at the root domain. Some offer ALIAS, ANAME or CNAME flattening.
Why does SSL work on root but not www?
The SSL certificate may not include www, or the www hostname may point to a different destination.
Can root and www point to different websites?
Technically yes, but for most public websites it is better to keep them consistent or redirect one to the other.
Related tools
Use these free tools to verify your configuration after applying changes.
Related guides
Browse all DNS & Domain guides →Need help applying this fix?
Send us your domain, report link or issue details. CheckDomainHealth will review the request and route it to the right technical team if hands-on support is needed.
Was this guide helpful?
Your feedback helps us improve our guides for everyone.
Thanks for your feedback!