Setting www version as canonical in DNS

Hi guys

So I have an A records with “@” pointing towards my IP. and a CNAME record point “www” to “@”

But My WordPress website’s default URL is the “WWW” version. So shouldn’t the records be the other way around? A record of “www” pointing towards the IP and CNAME of “@” pointing towards “WWW”?

Are there any disadvantages of the wrong configuration because the website works fine?

Hi @enslavedmasons,

The way you have it currently is the most common setup. This is because you usually cannot have a CNAME record for the root domain (@) in DNS. Cloudflare offers CNAME flattening that can turn a CNAME into an A record on the root domain, if you need this, but most do not.

As for your question about the ‘correct’ way to do it, it really doesn’t matter, DNS doesn’t dictate which you are using, the CNAME just means that they both point to the same place, and the redirects you have in place and which your site actually works on will dictate which you are using, and therefore which one search engines will redirect.

In short, there’s nothing wrong with what you have currently, and there is no need to change anything if it all works.

3 Likes

Yes, I did see the flattening notice from Cloudflare when I tried that.

Thank you for the clarification.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.