How to setup DNS to fwd root domain to www?

Hello expert,

How do we setup DNS in Cloudflare to forward root domain to www?

For example, how to forward mysite(.)com to www(.)mysite(.)com

Is below setup correct?

Type: Cname
Name: @
Target: www(.)mysite(.)com

As far as DNS alone is concerned, that is correct.

But I’d really suggest to use the search :wink:#tutorial

1 Like

A CNAME is not a redirect.

A CNAME creates an alias for a canonical name. In your record (referenced by @) is the alias for the canonical name of Normally a CNAME at the apex of a domain is problematic due to no other records being permitted to exist in the same space as any other record types (DNSSEC records being an exception).

Thanks to Cloudflare employing CNAME flattening which synthesizes A and AAAA records, you are able to avoid the usual problems caused by creating a CNAME at the apex.

HTTP hostname headers is where the part about a CNAME not being a redirect becomes particularly relevant. Requests sent to will arrive at the same web server as requests for The request will still be asking for What happens next depends on how the origin web server is configured handle requests for If it has no configuration, you may arrive at the server’s default site. If the apex name has been configured as an alias for the www site, you will see its content, but it will appear as a duplicate site to search engines.

You will be better served by an actual HTTP redirect which will cause requests for' to automatically make a new request to Page rules used to be the only way to achieve that without creating the redirect on your origin server. Cloudflare’s new bulk redirects now offers another effective method of achieving the same.


From a DNS point of view, the OP’s setup is absolutely correct, though. And that was the OP’s question. That this is not enough for an HTTP redirect is a different story of course and that’s where @domjh’s lovely tutorials come in, which can be easily discovered with the search.


Thanks for guidance.

1 Like

You are genius. Thanks for your kind tips.

1 Like