CNAME and A record values for domain forwarding

Suppose I have two domains: firstdomain.com and seconddomain.com

I want firstdomain.com to forward to seconddomain.com

I can do this with a page rule firstdomain.com/* with temporary redirect to https://seconddomain.com

But I also need to have an A record for firstdomain.com and a CNAME for www set up in the DNS section.

what IP should I be using for the A record and what domain should I use for the CNAME?

Please see this post.

1 Like

That says to use 192.0.2.1 as the A record, but what about the CNAME value for www?

Personally I would create an A record for www and point it to 192.0.2.1 as well.

Why do you believe it needs a CNAME?

If I delete the CNAME www and add an A record www with 192.0.2.1 and then go to www.firstdomain.com, I get a connection timeout error.

If I instead have a CNAME www with my old registrar’s parking page (parking.namesilo.com), then the redirect works. I’d prefer not using parking.namesilo.com for that value since I am planning on transferring my domain to Cloudflare so am wondering what a reasonable value to put in there would be

Do you have a page rule in Cloudflare forwarding www?

Are you able to post a screenshot of the rules?

thanks for your help.

I was able to get it to work with an A record for www to 192.0.2.1 and changing the page rule from firstdomain.com/* to *firstdomain.com/*

1 Like

Glad it worked, this is the correct solution :slightly_smiling_face: Adding the * in front made it affect www as well as the root domain.

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