Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# This POC uses the API's "registrar" endpoint to change NS delegation of a Cloudflare registrar domain to NS outside of Cloudflare
# export account e-mail address and Global API key.
# Untested: New style APO token with appropriate perms may also work.
export CF_API_EMAIL=user@server.com
export CF_API_KEY=changeme
# replace "changeme" below with your actual account ID and "domain.com" with the domain to be changed
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/"changeme"/registrar/domains/"domain.com" \
-H "X-Auth-Email: $CF_API_EMAIL" \
-H "X-Auth-Key: $CF_API_KEY" \
-H "Content-Type: application/json" \
--data '{"name_servers":["ns1.namecheap.com","ns2.namecheap.com"],"privacy":true,"locked":true,"auto_renew":true}'
# Result should be something like:
# {"result":{"message":"Domain updates complete!"},"success":true,"errors":[],"messages":[]}
# whois the domain to confirm
@mfld-pub

This comment has been minimized.

Copy link
Owner Author

mfld-pub commented Jun 19, 2020

Verification:
cf_ns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.