CLI Reference
When installed globally via npm install -g dns-worker, access the following subcommands:
Main Daemon
Section titled “Main Daemon”dns-worker [options]Runs DNS Worker in the foreground. Command line flags override .env settings:
-s, --status: Display service and database runtime status-f, --force, -y, --yes: Bypass interactive confirmation prompt for reset command-p, --port, --http-port <number>: HTTP port (default: 10080)--https-port <number>: HTTPS port (default: 10443)--dns-port <number>: Classic UDP port (default: 53)--dot-port <number>: DoT port (default: 853)--dot-domain <domain>: Base domain name-u, --user <username>: Service execution user
Status & Diagnostics: status
Section titled “Status & Diagnostics: status”dns-worker statusInspects active listeners, port availability, TLS certificate validity, and SQLite database connectivity.
Configuration Management: config
Section titled “Configuration Management: config”# Print active configuration and persistent pathsdns-worker config show
# Print absolute path of active .env filedns-worker config path
# Scaffold clean .env template in standard directorydns-worker config init
# Print raw default templatedns-worker config templateFactory Reset: reset
Section titled “Factory Reset: reset”# Interactive factory reset (prompts for secondary confirmation)dns-worker reset
# Force reset without interactive confirmation (CI/automation)dns-worker reset --force# ordns-worker reset -yRestores the system to factory defaults:
- Restores Configuration: Overwrites
.envwith the factory default configuration template. - Wipes Database: Permanently drops all tables and unlinks the SQLite database files (
*.sqlite,*-wal,*-shm). - Reapplies Migrations: Automatically runs all D1/SQLite schema migrations from scratch, producing a pristine empty database ready for first-time onboarding.
- Two-Step Safety Confirmation: In interactive mode, prompts the user with
Are you sure you want to proceed with factory reset? (yes/no):to prevent accidental data loss in production environments.
Service Lifecycle: service
Section titled “Service Lifecycle: service”# Install system service (optional --user <username>)sudo dns-worker service install [--user <username>]
# Control service executionsudo dns-worker service startsudo dns-worker service stopsudo dns-worker service restart
# Enable / Disable autostart on system bootsudo dns-worker service enablesudo dns-worker service disable
# Live diagnostics & logssudo dns-worker service statussudo dns-worker service logs
# Completely remove servicesudo dns-worker service uninstall