category
The category command group manages domain categories - groups of domains that share the same schedule and unblock delay.
Overview
Section titled “Overview”Categories simplify configuration by letting you define settings once and apply them to multiple domains.
Subcommands
Section titled “Subcommands”| Subcommand | Description |
|---|---|
list | List all categories |
show | Show category details |
create | Create a new category |
add | Add domain to category |
remove | Remove domain from category |
delete | Delete a category |
category list
Section titled “category list”List all configured categories.
nextdns-blocker category listOutput
Section titled “Output”Categories (3)
ID Domains Delay Description──────────────────────────────────────────────────────────────social-media 4 4h Social networksgambling 3 never Betting and casino sitesstreaming 4 2h Video streamingNo Categories
Section titled “No Categories”No categories configured
Create a category: nextdns-blocker category create <id> [-d "description"]category show
Section titled “category show”Show detailed information about a category.
nextdns-blocker category show CATEGORY_IDExample
Section titled “Example”nextdns-blocker category show social-mediaOutput
Section titled “Output”Category: social-media━━━━━━━━━━━━━━━━━━━━━━
Description: Social networksUnblock Delay: 4h
Schedule: Mon-Fri: 12:00-13:00, 18:00-22:00 Sat-Sun: 10:00-23:00
Domains (4): - instagram.com - tiktok.com - snapchat.com - twitter.comCategory Not Found
Section titled “Category Not Found”nextdns-blocker category show nonexistentOutput:
Error: Category 'nonexistent' not foundCase Insensitive
Section titled “Case Insensitive”Category IDs are case-insensitive for lookups:
nextdns-blocker category show SOCIAL-MEDIA# Works the same as: category show social-mediacategory create
Section titled “category create”Create a new category.
nextdns-blocker category create CATEGORY_ID [OPTIONS]Options
Section titled “Options”| Option | Description |
|---|---|
-d, --description TEXT | Description for the category |
--delay TEXT | Unblock delay (e.g., 30m, 4h, 1d, never) |
Examples
Section titled “Examples”Basic creation:
nextdns-blocker category create gamingWith description:
nextdns-blocker category create gaming -d "Gaming platforms"With delay:
nextdns-blocker category create gambling --delay neverFull options:
nextdns-blocker category create streaming -d "Video streaming" --delay 2hOutput
Section titled “Output”Created category 'gaming'
Add domains with: nextdns-blocker category add gaming <domain>Validation Errors
Section titled “Validation Errors”Invalid ID format:
nextdns-blocker category create Invalid-IDError: Invalid category ID 'Invalid-ID'Must start with lowercase letter, contain only lowercase letters, numbers, and hyphensCategory exists:
nextdns-blocker category create social-mediaError: Category 'social-media' already existsInvalid delay:
nextdns-blocker category create test --delay invalidError: Invalid delay format 'invalid'Valid formats: 0, 30m, 1h, 4h, 24h, 1d, neverID Requirements
Section titled “ID Requirements”- Must start with a lowercase letter
- Only lowercase letters, numbers, and hyphens
- Maximum 50 characters
Valid: social-media, gaming, work-tools, category123
Invalid: Social-Media, 123gaming, -category, gaming_sites
category add
Section titled “category add”Add a domain to a category.
nextdns-blocker category add CATEGORY_ID DOMAINExample
Section titled “Example”nextdns-blocker category add social-media reddit.comOutput
Section titled “Output”Added 'reddit.com' to category 'social-media'Validation Errors
Section titled “Validation Errors”Domain already in category:
nextdns-blocker category add social-media facebook.comDomain 'facebook.com' already exists in category 'social-media'Invalid domain format:
nextdns-blocker category add social-media "invalid domain!"Error: Invalid domain format 'invalid domain!'Category not found:
nextdns-blocker category add nonexistent test.comError: Category 'nonexistent' not foundPanic Mode
Section titled “Panic Mode”Adding domains is blocked during panic mode:
nextdns-blocker category add social-media test.comError: Cannot modify categories during panic modecategory remove
Section titled “category remove”Remove a domain from a category.
nextdns-blocker category remove CATEGORY_ID DOMAIN [OPTIONS]Options
Section titled “Options”| Option | Description |
|---|---|
-y, --yes | Skip confirmation prompt |
Example
Section titled “Example”nextdns-blocker category remove social-media reddit.comOutput
Section titled “Output”Remove 'reddit.com' from category 'social-media'? [y/N]: yRemoved 'reddit.com' from category 'social-media'Skip Confirmation
Section titled “Skip Confirmation”nextdns-blocker category remove social-media reddit.com -yValidation Errors
Section titled “Validation Errors”Domain not in category:
nextdns-blocker category remove social-media unknown.comError: Domain 'unknown.com' not found in category 'social-media'category delete
Section titled “category delete”Delete a category entirely.
nextdns-blocker category delete CATEGORY_ID [OPTIONS]Options
Section titled “Options”| Option | Description |
|---|---|
-y, --yes | Skip confirmation prompt |
Example
Section titled “Example”nextdns-blocker category delete streamingOutput
Section titled “Output”Delete category 'streaming'? (2 domains will be removed) [y/N]: yDeleted category 'streaming'Skip Confirmation
Section titled “Skip Confirmation”nextdns-blocker category delete streaming -yValidation Errors
Section titled “Validation Errors”Category not found:
nextdns-blocker category delete nonexistentError: Category 'nonexistent' not foundPanic Mode
Section titled “Panic Mode”Deleting categories is blocked during panic mode:
nextdns-blocker category delete gaming -yError: Cannot modify categories during panic modeWorkflow Examples
Section titled “Workflow Examples”Set Up Social Media Blocking
Section titled “Set Up Social Media Blocking”# Create the categorynextdns-blocker category create social-media -d "Social networks" --delay 4h
# Add domainsnextdns-blocker category add social-media facebook.comnextdns-blocker category add social-media instagram.comnextdns-blocker category add social-media twitter.comnextdns-blocker category add social-media tiktok.com
# Verifynextdns-blocker category show social-media
# Edit config to add schedulenextdns-blocker config editReorganize Domains
Section titled “Reorganize Domains”# List current categoriesnextdns-blocker category list
# Move domain from one category to anothernextdns-blocker category remove streaming youtube.com -ynextdns-blocker category add social-media youtube.com
# Verifynextdns-blocker category show social-mediaClean Up Categories
Section titled “Clean Up Categories”# Remove unused domainsnextdns-blocker category remove gaming oldgame.com -y
# Delete empty categorynextdns-blocker category delete old-category -yRelated
Section titled “Related”- Categories Configuration - Full configuration reference
- Blocklist - Individual domain configuration
- Schedules - Time-based access rules