Separate decisions from enforcement
Think of the app as three small responsibilities. A rule source describes blocked names. A matcher turns a destination into a decision. An enforcement adapter applies that decision through a browser or resolver. Keeping them separate lets you test matching without changing network settings and replace one platform adapter without rewriting the policy.
For a first project, create a local rule file and a synthetic test runner before building a settings screen. Record the rule version and whether enforcement loaded successfully. A green switch that only means “the interface opened” is misleading. Status should describe the actual layer, such as “rules loaded in this browser profile,” rather than “device protected.”
Start inside one browser
Firefox implements the WebExtensions model, which provides a recognizable structure for extension permissions, background logic, and user interfaces. Chromium also supports extensions, but request interception capabilities differ across browsers and extension models. Manifest V3 is important when planning declarative request rules: the browser evaluates submitted rules rather than running arbitrary blocking logic for every request.
uBlock Origin is a real example of browser-based filtering and of why platform capabilities matter. It is not a template for a universal gambling barrier, and its behavior should not be assumed to match every extension environment. Check the target browser’s documentation for rule limits, supported conditions, private-browsing behavior, and permission requirements before choosing an API.
A browser approach gives you a modest, visible scope. It does not cover another profile, native applications, or an extension that has been disabled. State those exclusions in the interface.
Use DNS for names, not page content
Pi-hole is a network-level DNS filtering project. Unbound is a validating, recursive DNS resolver, while dnsmasq combines lightweight DNS-related functions with other network services. These names describe different jobs, not interchangeable products. A DNS-based blocker answers selected name queries with a refusal or a configured blocking response; it does not read the encrypted contents of a web page.
On Linux, systemd-resolved and NetworkManager can both be involved in how applications reach a DNS resolver. Changing one configuration file without understanding that chain can leave some requests using another route. Cached answers may also delay visible changes. Map the resolver path before assuming a rule has taken effect.
| Approach | Control needed | Scope to declare |
|---|---|---|
| Extension | Installation and request-rule permissions | Configured browser and profiles |
| Local DNS | Resolver and device network settings | Queries that reach that resolver |
| Network DNS | Managed network configuration | Connected devices using that path |
Respect operating-system boundaries
Android’s VpnService can support a local traffic-routing design, but it brings lifecycle, consent, and routing responsibilities. It is not simply a list of domains with a background timer. Another VPN configuration can conflict with the intended route, and applications may behave differently when connectivity changes.
On iOS, Network Extension capabilities depend on the type of extension and relevant entitlements. An ordinary app cannot assume unrestricted interception. Apple’s Screen Time is a built-in control system, not a promise that a custom app can duplicate its powers. Windows and macOS likewise distinguish ordinary application access from administrator-level configuration.
Choose the smallest privilege that can perform the declared job. Document installation, removal, and recovery rather than disguising privilege as permanent protection.
Build a narrow first version
- Choose one operating system and one enforcement point.
- Write exact-host and subdomain behavior as separate policy choices.
- Load a small synthetic list and display its version.
- Apply the rules and test both blocked and allowed destinations.
- Restart the browser or service and verify that enforcement returns.
- Document routes the project does not cover.
Only add another layer when it closes a named gap. More components also mean more permissions, update paths, and opportunities for disagreement. A small architecture with visible limitations is easier to maintain than an opaque stack.