Skip to content

Instantly share code, notes, and snippets.

@gabrielbarros
Last active June 7, 2025 17:37
Show Gist options
  • Save gabrielbarros/912427a6a689c8973ce133b0bf7dd98f to your computer and use it in GitHub Desktop.
Save gabrielbarros/912427a6a689c8973ce133b0bf7dd98f to your computer and use it in GitHub Desktop.
NextDNS purge denylist
#!/usr/bin/env bash
API_KEY=xxx # Get it from https://my.nextdns.io/account
PROFILE_ID=xxxxxx # Get it from https://my.nextdns.io
url=https://api.nextdns.io/profiles/$PROFILE_ID/denylist
curl -s -H "X-Api-Key: $API_KEY" $url | jq -r '.data[] | select(.active == true) | .id' | while read -r domain; do
echo "Deleting $domain..."
curl -X DELETE -H "X-Api-Key: $API_KEY" $url/$domain
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment