Skip to content

Configuration

MateusBMP edited this page Nov 16, 2026 · 4 revisions

Configuration

Everything except the firewall options is stored by the daemon in /var/lib/blockads-linux/ and changed through the GUI or blockadsctl.

DNS upstream

  • Presets: System (the network's DNS), Quad9, AdGuard, Cloudflare (and Family), Google, OpenDNS (and FamilyShield), DNSBunker.
  • Custom servers: plain UDP/TCP, DNS over TLS, DNS over HTTPS (HTTP/2), also as sdns:// stamps. DNS over QUIC and HTTP/3 are not supported.
  • Default: Quad9 over DoH, falling back to Quad9 plain DNS with a visible warning.
  • Encrypted only disables the plain fallback. If the clock is wrong (certificates "not yet valid" or "expired"), plain DNS is still allowed for NTP server names only, so the time daemon can fix the clock.
  • When the upstream is unreachable (captive portal, outage) the policy moves to the network's DNS, still filtered. It never turns protection off.

Filter lists

  • The catalog has the same ~100 lists as blockads-android, grouped as ads, privacy, social, annoyances, security, regional and other.
  • Defaults: StevenBlack Unified, EasyPrivacy, Online Malicious URL Blocklist (from URLhaus data), Phishing URL Blocklist, Dandelion Sprout Anti-Malware, uBlock Origin Badware risks.
  • Lists are downloaded from their original publishers and compiled locally by blockads-update (hourly timer; auto-update every 6/12/24/48 h or manual; "unmetered connections only" is available).
  • Custom lists can merge one or more URLs. Adding a URL needs the admin password, because it makes the system download from a new host.
  • Rule syntax is the same as Android's (hosts, adblock and plain domains, matching subdomains). Difference: @@ exceptions are honored, but only within the list that declares them.

Your rules

  • Block, allow (whitelist) and *.example.com (subdomains only).
  • Precedence: allow, then whitelist, then block, then the lists.
  • Import from a file or the clipboard, and export.

Other filtering options

Option Default Notes
Block response 0.0.0.0 / :: or NXDOMAIN, REFUSED
SafeSearch (Google, Bing), YouTube Restricted off
DoH blocklist off blocks 34 known DoH server names, so browsers cannot bypass the filter
CNAME check on also blocks answers whose CNAME chain points to a blocked name (CNAME cloaking)
Preferred IP type both IPv4 or IPv6 only
Query log on retention, pause recording, clear

Trusted networks

Trusted networks are keyed by the NetworkManager connection UUID. NetworkManager picks a Wi-Fi connection by the network's name, so a look-alike network with the same name (an "evil twin") would activate the same connection and be trusted too. To prevent that, a Wi-Fi network can be pinned to one access point (its BSSID): GUI → Networks → "Only through this access point", or blockadsctl networks add --pin-ap. A pinned network is trusted only while you are connected through that access point; through any other one it is filtered normally. A network whose Wi-Fi has several access points (mesh, office) then needs one entry per access point, or no pin. Two modes:

  • pause: no filtering while connected (state trusted).
  • network DNS: keep filtering but use that network's DNS servers, e.g. for internal names on a work network.

The Networks page also shows split DNS (per-link servers and domains), for example from a WireGuard VPN.

Containers and VMs (bridge redirect)

DNS from Docker bridge containers does not pass through OUTPUT, so it is not filtered by default. (Resolvers that run on the host for the bridge, such as libvirt's dnsmasq or podman's aardvark-dns, are filtered already, because their upstream queries leave through OUTPUT.)

The opt-in bridge redirect filters them too. Set bridge_interfaces (GUI: Advanced → Containers and VMs). The suggested value is:

docker0,br-+,virbr+,podman+,cni-podman+,lxcbr+,incusbr+

This enables blockadsd-bridge.socket on port 154 and redirects port-53 traffic arriving on those interfaces to it. It is not an open resolver: only redirected packets reach port 154, and the daemon answers only sources in the subnets of matching interfaces. DNS over TLS from containers is not blocked.

Tested with Docker (default and user networks), podman, libvirt and firewalld zones.

firewall.conf

/etc/blockads-linux/firewall.conf is root-owned, at most 16 KiB, with a strict schema. The GUI changes it with pkexec blockads-fw set-config and restarts the service.

port=153                 # admin-only; must match the socket units
ipv6=auto                # auto | off
block_dot=true           # reject DNS over TLS/QUIC on port 853
block_webrtc=false       # reject STUN/TURN ports (WebRTC IP leaks)
bypass_cidrs=100.100.100.100/32,fd7a:115c:a1e0::53/128   # never redirected (Tailscale MagicDNS)
bridge_interfaces=       # empty = off; see above
bridge_port=154          # admin-only; must match blockadsd-bridge.socket

Ports must be privileged (1–1023), not 9 or 53, and different from each other. An invalid file makes the service fail to start, which means DNS stays unfiltered (fail-open).

Backup and restore

Settings and rules can be saved as JSON and restored (blockadsctl backup / restore, or Settings → Backup / Restore…). A BlockAds for Android blockads_settings.json (v1 and v2) can be imported; it is merged into the current settings.

Clone this wiki locally