This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Verification:
