Skip to content

Instantly share code, notes, and snippets.

@gabrielbarros
Last active April 23, 2025 21:09
Show Gist options
  • Save gabrielbarros/bf75290389f2b237c341db22b24e0b63 to your computer and use it in GitHub Desktop.
Save gabrielbarros/bf75290389f2b237c341db22b24e0b63 to your computer and use it in GitHub Desktop.
NextDNS import 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
tac denylist.txt | while read -r domain; do
echo "Adding $domain..."
curl -d $"{\"id\": \"$domain\"}" \
-H 'Content-Type: application/json' \
-H "X-Api-Key: $API_KEY" $url
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment