Last active
June 7, 2025 17:37
-
-
Save gabrielbarros/912427a6a689c8973ce133b0bf7dd98f to your computer and use it in GitHub Desktop.
NextDNS purge denylist
This file contains hidden or 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
#!/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