Account Dash Ticket - please wipe DNS records

Hi everyone hope you can help. I have multiple Domains on Cloudflare. since i have migrated my hosting i had to change all my DNS records. There were around 100 or more DNS records per domain. On my main domain i already wiped all records by hand which took forever. Since i dont want to do it 500 times by hand i was wondering if there was a way to wipe all DNS records for one domain? Ive tried to contact Support but just got a Bot answer that support cant help with DNS problems.

Hope anyone knows a solution that works?!

ticket number 2400128 {redacted}

Kind regards

Have you tried to use the API?

Here is an example script to search for all A records with a particular target, and change them to a new target IP address.

#!/bin/bash
auth_email="[email protected]"
auth_key="redacted"
zone_id="dummy"

record_list=( $(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/${zone_id}/dns_records?per_page=500&type=A&content=192.0.2.1" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json" | jq -r '.result[].id') )

for id in "${record_list[@]}"
do
	curl -s -X PATCH "https://api.cloudflare.com/client/v4/zones/${zone_id}/dns_records/${id}" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json" --data '{"content":"192.0.2.2"}'
done
3 Likes

Sorry but i dont understand ANYTHING of what you just wrote?!
can you point me to a totorial or give a more in depth explenation?

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