Advoid is a local DNS adblocker for macOS. It resolves DNS queries directly from the loopback interface, blocking known ad and telemetry domains using a compiled LLVM IR matching engine.
- Engine: Written in LLVM IR (
advoid.ll), processing UDP packets on port 53. - Blocklist Compiler: A Go utility (
compile_blocklist.go) that fetches the StevenBlack hosts list, filters it against a hardcoded system Safelist, and compiles it into an LLVMswitchstatement using an FNV-1a hash. - UI: A macOS Menu Bar application written in Swift for toggling DNS state dynamically across all active system network interfaces.
- Memory Model: The engine operates without dynamic heap allocations during packet processing, using vectorized 64-bit register writes to mutate the stack buffer at wire-speed.
For a comprehensive technical deep-dive into the FNV-1a hashing logic and system daemonization, read the Architecture Document.
When the app launches, it routes macOS DNS to 127.0.0.1.
- Enable: Binds system DNS to the local engine.
- Disable: Restores the system to default DHCP DNS routing.
The installer script compiles the engine and UI, and packages them into /Applications/Advoid.app.
git clone https://github.com/bneb/advoid.git
cd advoid
./install.shUpon first launch, Advoid will prompt for administrator privileges to bootstrap the launchd background engine.
To gracefully teardown the daemon, restore DNS settings, and remove the binary:
./uninstall.shAdvoid strictly manages its lifecycle to prevent routing DNS to a dead port:
- Startup: The UI verifies the
launchdengine's presence. If installation fails, the UI terminates. - Termination: Quitting the application unbinds DNS from localhost.
- Reinstallation: The
install.shscript restores DNS to DHCP before clearing legacy daemons to maintain connectivity during the build.
Advoid does not log blocked domains to disk to avoid I/O blocking. To trace DNS requests, use macOS packet tracing:
sudo tcpdump -i lo0 -n udp port 53