Automating CNAME flattening with cloudflare pages

I’m having trouble with CNAME flattening and Cloudflare pages. I have a Cloudflare pages project, and I’d like to be able to automate the process of pointing domains to the project.

I used the api to add a domain, and create two dns records. One CNAME at the root to the cloudflare pages url, and one cname for www to the root domain. I seem to always get a timeout error.

Is it possible to point a domain to a cloudflare pages project, solely through the cloudflare api? There’s not a endpoint to add a custom domain to a cloudflare pages project so what are my options?

Unfortunately you can definitely add a CNAME to the DNS tab, but it won’t be doable on the Pages’ side for now.

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