Skip to content

Instantly share code, notes, and snippets.

@gabrielbarros
Last active November 29, 2024 00:18
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
tac denylist.txt | while read -r domain; do echo $domain; curl -d $"{\"id\": \"$domain\"}" -H 'Content-Type: application/json' -H "X-Api-Key: $API_KEY" https://api.nextdns.io/profiles/$PROFILE_ID/denylist; sleep 1; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment