Is it possible to add 2 content on a cname?

Hi Cloudflare community and Team

I have a small issue and i need an expert to enlighten me,

Issue:
my website works on [medousadevelopers.com]
But
Does not work on [https://www.medousadevelopers.com]

Solution:
I understand that the www is not declared in the A records, which is a fact,
But!
I cannot add another A nor Cname record because i have another one which is needed bcz i had issues with gmail and google hosted mails that i cannot touch bcz it fixed it.

What i ask the community Experts:
Possible solution 1 that i thought but i want to ask you guyz if its valid or some clarification:
Can i add 2 content on a Cname without affecting the functionality of it?
ie.
Type: CNAME
Name: WWW
Content: ghs.googlehosted . com

And what i ask is if i add on the content below

Content: ghs.googlehosted.com,‘medousadevelopers . com

Will it work without affecting the first ghs.googlehosted . com ?

Its crazy that with other registrators i can add more then 1 www record and with cloudflare its not possible… i persist that there should be a way because i dont want to change cloudflare…

Please help :slight_smile:

Welcome to the Cloudflare Community!

Strictly speaking within Cloudflare, that is true, however by the fact you have a CNAME created and unproxied, DNS Resolvers follow that CNAME to resolve requested records.

;; QUESTION SECTION:
;www.medousadevelopers.com. IN A

;; ANSWER SECTION:
www.medousadevelopers.com. 3600 IN CNAME ghs.googlehosted.com.
ghs.googlehosted.com. 300 IN A 142.251.16.121

Your www subdomain does have A/AAAA records returned via the CNAME.

A CNAME on www wouldn’t have anything to do with mail

No, that’s not possible. A CNAME is a “canonical redirect”, you’re basically saying “look over here”, having two would be saying “look over in two places for your record”.

Cloudflare’s not doing anything weird here

It looks like you already do have a CNAME on www for ghs.googlehosted.com, but it’s not working, probably because whichever Google Product you are using, you haven’t added your www as another custom domain to be allowed.

The better option here though would be to pick to use either www or apex (medouasdevelopers.com), and redirect the other to the one you pick. If you want your apex to be the location for your site, you can follow this guide here to add a Cloudflare redirect from www to apex (just make sure to remove the CNAME on www first): Redirecting www to domain apex · Cloudflare Pages docs. Otherwise, search engines punish for duplicate content.

Let me know if that helps your confusion, I understand that it can be a bit confusing with all of the record types and options

2 Likes

Hi @Chaika backtick example

test cloudflare community error reply

Hi Chaika,

Thanks for your reply and input.

I tried the suggestion you offered and it did not work.

It gave me the same error A CNAME record with that host already exists. For more details, refer to (Code: 81054)

I also tried the Rules in Redirect and it also did not work…

I put the rules correct to redirect from w w w to the apex and nothing…

Still need help, anyone ?

You have to delete the unproxied www CNAME first

Yea, no redirect rules or anything like that will work without a proxied record existing, the traffic for www currently isn’t going through Cloudflare’s http request flow, so Cloudflare can’t act on it with redirects or anything.

1 Like

Thanks for the clarity.

However

I cant Delete the Cname www record. Why?

We had an issue with sending emails to gmail and google hosted emails, it was giving me a spam response everytime the company sent mails to gmail or google hosted and never went.

When i spoke to Google they told me that i need to add that Cname record www to point to ghs. googlehosted . com

It did resolved the issue, if i remove this record the company will have issues again with gmail and google hosted mail servers.

We need to find a solution without removing that record?!

A cname on www to google hosting, which is used for google sites, isn’t going to have anything to do with email. Especially considering you don’t even use google for email, your domain uses Microsoft 365 looks like.

The only way you’d find a solution without removing that record is probably by signing up for google sites and getting google to return the redirect, but it doesn’t even look like you use them, nor do I know if google sites even offers redirects like that.

Pretty much all I can say is that I don’t see how a cname on www has anything to do with email delivery, especially when it’s to google sites and you don’t seem to even use them. If you’re having email delivery issues, try testing with https://www.mail-tester.com/ and see if spf/dkim/something else is broken, you can look at Troubleshooting email issues · Cloudflare DNS docs as well.

Tell me about it.

The issue started when i propagated to a new domain registrar… Apparently there was some bad records on the mail and suddenly any email the company was sending to gmail or google hosted mails returned an immediate error that google says that my domain is spam and did not delivered my mail to the sender, however i was able to receive mails from gmail…

Then when i spoke to google support, they told me to add this www record which apparently actually fixed the issue and now we dont receive spam. this record is quite sensitive bcz if i remove that record then the whole company “im assuming” will have this issue again and we dont want that…

thanks for the tips i will look into them and also i have some other troubleshoots to try out today and see if that remediates the issue.

If anyone has any more ideas into how to redirect www to apex other then a cname record please enlighten us :dotted_line_face:

Good point on the forward url.

Im testing it now, i did above, let me know if all good or could be better.

Im surprised why its not working already but i will give it 48 hours to confirm that this above is not working.

i already tried with the “Redirect Rule” Beta version and waited 48 hours with no result.

Lets see if above will work.

I believe it should work bcz thats not a record its separate and there is no duplicate unless the issue is with the Cname Record that i have for the www that is pointing to google and its clashing with it as below:

Case
I have a record www pointing to google
i have a forward url pointing to apex from www.medousadevelopers.com

None of the rules/redirects are going to work as long as that hostname is unproxied. Cloudflare can’t act on traffic not flowing through it.

The CNAME resolves to an A record when DNS Resolvers follow it, it wouldn’t matter if it didn’t though because traffic still isn’t flowing through Cloudflare.

You’d need a proxied record, like the originless record Cloudflare recommends for redirects
AAAA www 100:: Proxied, and you’d have to delete the cname first. You’re looking down the wrong direction, the cname isn’t the thing fixing your email issues. Just think about it logically: Every single website would need a www cname pointing to google if they just want to email them? Someone should tell https://www.cloudflare.com/ then.

Try mail tester and other tools to diagnose mail issues, ensure your spf/dkim is configured correctly, etc.

2 Likes

I understand that it does not make sense, However if you don’t " Test " things you dont know.

I will take the risk and test it at some point, bcz its a fact when i added the Cname to google the mails started working… or is it? maybe they got fixed alone after some time because of the propagation of the registrar and until Google updates its system it wanted a week or so…

hmmm… as im thinking now i thought of maybe because i created a google account with a domain email this could have created the spam issue with google ? as Google might have seen that this domain created a gmail but did not add the cname of google and it resolved it as spam ? then maybe by deleting the google account that is created with that domain could resolve the issue ?

Some food for thought and to look at for later on testing.