Skip to main content

Automated domain blocking controller for NextDNS with per-domain scheduling

Project description

NextDNS Blocker

PyPI version PyPI downloads Python versions License CI Homebrew

Automated domain blocking with per-domain scheduling via the NextDNS API. Build healthier digital habits through intelligent scheduling and friction-based protection.

Features

  • Per-domain scheduling - Configure unique availability hours for each domain
  • Domain categories - Group domains together with shared schedules
  • NextDNS Parental Control - Enable/disable native NextDNS categories and services
  • Unblock delays - Add friction against impulsive unblocking (30m, 4h, 24h, or never)
  • Panic mode - Emergency lockdown that blocks all domains
  • Cross-platform - Native support for macOS, Linux, and Windows
  • Automatic sync - Watchdog runs every 2 minutes to enforce schedules
  • Discord notifications - Real-time alerts for block/unblock events
  • Allowlist with schedules - Time-based exceptions for specific domains
  • Priority-based filtering - Allowlist always wins over category/service blocks

Quick Install

Homebrew (macOS/Linux)

brew tap aristeoibarra/tap
brew install nextdns-blocker
nextdns-blocker init

pip

pip install nextdns-blocker
nextdns-blocker init

Docker

git clone https://github.com/aristeoibarra/nextdns-blocker.git
cd nextdns-blocker
cp .env.example .env && cp config.json.example config.json
docker compose up -d

Quick Start

  1. Get your NextDNS API Key and Profile ID
  2. Run nextdns-blocker init to configure
  3. Edit your domains: nextdns-blocker config edit
  4. Install watchdog: nextdns-blocker watchdog install

Documentation

For complete documentation, visit: nextdns-blocker.pages.dev

Basic Commands

nextdns-blocker config sync       # Sync based on schedules
nextdns-blocker status            # Check current blocking status
nextdns-blocker pause [minutes]   # Pause blocking temporarily
nextdns-blocker resume            # Resume blocking
nextdns-blocker unblock <domain>  # Manually unblock a domain
nextdns-blocker panic <minutes>   # Activate emergency lockdown

Example Configuration

{
  "blocklist": [
    {
      "domain": "reddit.com",
      "unblock_delay": "30m",
      "schedule": {
        "available_hours": [
          {
            "days": ["monday", "tuesday", "wednesday", "thursday", "friday"],
            "time_ranges": [
              {"start": "12:00", "end": "13:00"},
              {"start": "18:00", "end": "22:00"}
            ]
          }
        ]
      }
    }
  ]
}

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nextdns_blocker-7.0.0.tar.gz (250.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nextdns_blocker-7.0.0-py3-none-any.whl (131.3 kB view details)

Uploaded Python 3

File details

Details for the file nextdns_blocker-7.0.0.tar.gz.

File metadata

  • Download URL: nextdns_blocker-7.0.0.tar.gz
  • Upload date:
  • Size: 250.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nextdns_blocker-7.0.0.tar.gz
Algorithm Hash digest
SHA256 a9fd0d682871e95f41fc85cb50df4393ef4c730b5661c4827322608bde089b55
MD5 94cec17f6d9004aacfd718b38d0e81b2
BLAKE2b-256 cfbfdb617dd2d4729d7f3f0072b6d092533107b738029cc2d972d81eeb99e235

See more details on using hashes here.

Provenance

The following attestation bundles were made for nextdns_blocker-7.0.0.tar.gz:

Publisher: publish.yml on aristeoibarra/nextdns-blocker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nextdns_blocker-7.0.0-py3-none-any.whl.

File metadata

  • Download URL: nextdns_blocker-7.0.0-py3-none-any.whl
  • Upload date:
  • Size: 131.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nextdns_blocker-7.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4a6ea045ca382245769761b647eb7b74a7ebb57d10d6a058a6484571799724e
MD5 6f14dfef3a13f6205105f4d15d362be8
BLAKE2b-256 48e0e851219aa010148ef7b1c12e9ffd8f737667c51257caff26089d30e225a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for nextdns_blocker-7.0.0-py3-none-any.whl:

Publisher: publish.yml on aristeoibarra/nextdns-blocker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page