How ugzv/ublockdnsclient works
uBlockDNS Client installs and manages a local system service that redirects device DNS through a filtering proxy, while dashboard policy remains remote. The main workflow is CLI command → service setup → local proxy and system DNS activation; at runtime the proxy uses encrypted upstream DNS, with endpoint recovery and optional rule-update handling. Status and readiness checks verify service and DNS health. Relationships are based on the README and shown excerpts or SOURCE INDEX references; unsampled implementation details are not expanded.
Main entry points: cli.go CLI commands · runtime_run.go Runtime startup · install.go Install service · rules_watcher.go Rule update stream
Components 21
CLI and service lifecycle
- CLI commands
cli.go - Install service
internal/service/install.go - Service control
internal/service/control.go - Status and readiness
internal/service/status.go
DNS runtime
- Runtime startup
internal/runtime/runtime_run.go - Local DNS proxy
internal/runtime/proxy_runner.go - DoH bootstrap
internal/runtime/dns_bootstrap.go - Endpoint fallback
internal/runtime/endpoint_fallback.go - Network monitoring
internal/runtime/network_watch.go - Resolver retries
internal/runtime/resolver_retry.go - Rule update stream
internal/runtime/rules_watcher.go
Platform DNS
- System DNS settings
internal/core/dns_activate.go - DNS probes
internal/core/dns_probe.go - OS cache flush
internal/core/dns_cache_flush.go
State and updates
- Install state
internal/state/install_state_store.go - Token storage
internal/state/token_store.go - Automatic updates
internal/runtime/auto_update.go
Other components
- Operator
- uBlockDNS DoH service
- Dashboard
- Signed releases
Connections 24
- Operator → CLI commands: runs commands
- CLI commands → Install service: installs service
- CLI commands → Service control: manages service
cli.go - CLI commands → Status and readiness: checks readiness
cli.go - Install service → System DNS settings: activates DNS
internal/service/install.go - Install service → Install state: persists config
internal/service/install.go - Service control → System DNS settings: restores DNS
internal/service/control.go - Status and readiness → DNS probes: probes local DNS
internal/service/status.go - Status and readiness → Install state: loads config
internal/service/status.go - Runtime startup → DoH bootstrap: resolves upstream
internal/runtime/runtime_run.go - Runtime startup → Local DNS proxy: starts proxy
internal/runtime/runtime_run.go - Runtime startup → Endpoint fallback: configures endpoints
internal/runtime/runtime_run.go - Runtime startup → Rule update stream: starts watcher
internal/runtime/runtime_run.go - Local DNS proxy → uBlockDNS DoH service: forwards encrypted DNS
- Endpoint fallback → uBlockDNS DoH service: tests DoH endpoints
internal/runtime/endpoint_fallback.go - Endpoint fallback → System DNS settings: discovers fallback DNS
internal/runtime/endpoint_fallback.go - Rule update stream → Dashboard: receives rule changes
- Rule update stream → OS cache flush: flushes OS caches
internal/runtime/rules_watcher.go - Rule update stream → Local DNS proxy: purges DNS cache
- Automatic updates → Signed releases: checks signed releases
- CLI commands → Runtime startup: runs daemon
- Install service → Token storage: stores credentials
- Network monitoring → Endpoint fallback: triggers recovery
- Resolver retries → Local DNS proxy: retries resolution