API to enable Foundation DNS on an Enterprise zone

Is there any API, official or otherwise to enable Foundation DNS on an enterprise zone? I have 500 that I need to enable and I am discovering that cf enterprise support isn't fast.
2 Replies
SuperHelpflare
SuperHelpflare3mo ago
Support AI
According to the documentation, yes, there is an API to enable Foundation DNS on a zone. You can use the Update DNS Settings endpoint to send a PATCH request to enable Foundation DNS. Here is an example of the API request:
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_settings" \
--request PATCH \
--header "X-Auth-Email: $CLOUDFLARE_EMAIL" \
--header "X-Auth-Key: $CLOUDFLARE_API_KEY" \
--json '{
"foundation_dns": true
}'
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_settings" \
--request PATCH \
--header "X-Auth-Email: $CLOUDFLARE_EMAIL" \
--header "X-Auth-Key: $CLOUDFLARE_API_KEY" \
--json '{
"foundation_dns": true
}'
You will need to replace $ZONE_ID, $CLOUDFLARE_EMAIL, and $CLOUDFLARE_API_KEY with your actual zone ID, email, and API key. You can use this API to enable Foundation DNS on multiple zones programmatically, which should help you with your task of enabling it on 500 zones. Source: https://developers.cloudflare.com/dns/foundation-dns/setup/
Feedback
Feedback has been submitted! Thank you :)
This is an AI generated response, it may not be 100% accurate. Please validate the output. You can ask followups by replying to this message or mentioning me.
username#0000
username#0000OP3mo ago
indeed the AI nailed it and the zones are now all foundation. I originally attempted this with terraform, and failed there, but then I think got misled into believing this was only possible in bulk, via the account team.

Did you find this page helpful?