www
is another record on the domain, it stands separate from the full domain. Understand that com
in essence is also a domain (hence Top Level Domain) and domain.com
(called root or naked domain) therefor is a sub domain of com
. www.domain.com
is a third level or sub- domain. So, assigning a CNAME to www.domain.com
does not cascade that record information to its parent domain.com
.
Sadly you cannot assign a CNAME to a root domain, this has to be an A or AAAA record. The reason for this is that CNAME record cannot be combined with (most) other records including the NS record which is required to explain to the internet what DNS records are connected to your root domain.
https://www.freecodecamp.org/news/why-cant-a-domain-s-root-be-a-cname-8cbab38e5f5c/
I can't remember precisely why but using an IP on the root domain doesn't work with FreeFlarum, see:
Sanguine You have to use a CNAME, otherwise it won't work. Note: if you use a CNAME on your top-level domain (eg xyz.com), you won't be able to use other DNS features for that top level (such as email or other subdomains). So it is recommended to use a subdomain.
Understand that officially a CNAME on a root domain does not work, see my explanation above. So the best solution is to either find a way to redirect your traffic from the root domain to www or use a different sub domain completely.