CNAME Redirect

Currently, my root domain redirects you to my Github page. I want to use a CNAME record to create github.mydomain.com and have that take you to my Github. However, you can’t just put in the IP address of the A record into a CNAME. I also can’t just put the direct link to my Github in the CNAME. Once this is done, I don’t want my root domain to go anywhere, so I can’t have github.mydomain.com point to my root domain. What am I missing here? How would I get this accomplished?

Also, side question, why does going to the IP address that your A record points to not work?

Thank you very much!

If you want to simply redirect to the GitHub page create an A record for github.example.com that points to a bogus IP (192.0.2.1 is a good one), make it proxied and create a Page Rule for github.example.com/* that forwards to where you want.

Mainly because the Cloudflare IPs are not dedicated to your DNS entries. Every Cloudflare IP will actually work for any :orange: domain (you can override the DNS in your hosts file if you want to test this.) It also limits Cloudflares ability to manage their infrastructure as they need to.

1 Like