rubixibuc
rubixibuc
CDCloudflare Developers
Created by rubixibuc on 7/28/2024 in #general-discussions
Clearing out all DNS records
So I saw there's API access to do this, but I think that's completely ridiculous! I just wrote some js to take care of it for me. Dropping here for future use
const sleep = (timeout = 3000) => new Promise(res => {
setTimeout(res, timeout)
})


(async () => {
for(record of document.querySelectorAll("[data-testid=dns-table-row-edit-link]")) {
record.click();
await sleep();
document.querySelector("[data-testid=dns-record-form-delete-button]").click()
await sleep();
document.querySelector("[data-testid=dns-delete-modal-confirm-button]").click()
}
})()
const sleep = (timeout = 3000) => new Promise(res => {
setTimeout(res, timeout)
})


(async () => {
for(record of document.querySelectorAll("[data-testid=dns-table-row-edit-link]")) {
record.click();
await sleep();
document.querySelector("[data-testid=dns-record-form-delete-button]").click()
await sleep();
document.querySelector("[data-testid=dns-delete-modal-confirm-button]").click()
}
})()
2 replies