Skip to content

Instantly share code, notes, and snippets.

@g3rd
Created December 22, 2018 16:04
Show Gist options
  • Save g3rd/5f51dddc11a12ac654eaa8111391ce06 to your computer and use it in GitHub Desktop.
Save g3rd/5f51dddc11a12ac654eaa8111391ce06 to your computer and use it in GitHub Desktop.
CloudFlare transfer domains
#!/bin/sh
# Get here: https://support.cloudflare.com/hc/en-us/articles/200167836-Where-do-I-find-my-Cloudflare-API-key-
export CF_API_EMAIL=you@example.com
export CF_API_KEY=abc123def456ghi789
# Grabbed mine out of the dashboard url
export CF_ACCOUNT_ID=abc123def456ghi789
for domain in $(cat domains.txt); do \
curl -X POST -H "X-Auth-Key: $CF_API_KEY" -H "X-Auth-Email: $CF_API_EMAIL" \
-H "Content-Type: application/json" \
"https://api.cloudflare.com/client/v4/zones" \
--data '{"account": {"id": "'$CF_ACCOUNT_ID'"}, "name":"'$domain'","jump_start":true}'; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment