UNBOUND-ADBLOCK(8) | System Manager's Manual | UNBOUND-ADBLOCK(8) |
unbound-adblock
—
create blocklists for use with unbound
unbound-adblock |
[-DVnx ] [-C
config-file] [-P
maxprocs] [-R
retry-limit] [-U
user-agent] [-W
output-file] [-f
blocklist-file] [-l
url-file] [-o
long-option] [-r
domain] [-u
url] [-w
whitelist-file] [file
...] |
unbound-adblock |
-h | -v |
unbound-adblock
allows you to turn your
favorite DNS server software into a DNS firewall.
It works by fetching popular lists of known malicious domains and then converting them into RPZ format which is suitable for ingestion by many DNS servers such as unbound(8), bind(2), PowerDNS and Knot Resolver.
It also supports unwind(8) as an optional backend to facilitate DNS firewalling on personal devices and on the go.
By default unbound-adblock
will attempt to
feed generated RPZ blocklist data into unbound(8).
If the -x
or -o
export-raw options are specified then generated data
will be output to stdout.
Common uses include:
The options are as follows:
-C
config-file-D
unbound-adblock
must
normally be run as the user _adblock, and this option
disables that check.-P
maxprocs0
to disable parallelism.-R
retry-limit0
to disable retries. Semantics for this option
differ based upon which URL fetch utility has been specified.-U
-V
-W
output-file-f
blocklist-file-h
-l
url-file-n
-o
long-option-r
domainNote: Whitelisting is only supported on the RPZ and Unbound local-data backends.
-u
url-v
-w
whitelist-fileNote: Whitelisting is only supported on the RPZ and local-data backends.
-x
unbound-adblock
to export
the generated blocklist data to stdout without interacting with
unbound(8) or unwind(8). This option
can be useful for exporting the generated blocklist data for external use.
This option may be used in conjunction with -o
format options to print RPZ, domain-only and unbound(8)
local-data format blocklists. Use of this option implies
-D
and -o
no-log.The (case insensitive) options are as follows:
custom-filter
|
no-custom-filter
-C
. Disabled by
default.log
|
no-log
strict
|
no-strict
unbound-adblock
to abort if it fails to fetch one
or more blocklists. Enabled by default.uid-check
|
no-uid-check
-D
description. Enabled by default.verbose
|
no-verbose
-V
description. Enabled by default.Export Functions:
domain
-x
.export-raw
-x
.Blocklist Output Formatting:
Note: If multiple output formats are specified, the last specified option is used.
RPZ
unbound
unwind
Custom DNS responses:
Notes: If multiple custom DNS responses are specified, the last specified option is used. These options have no effect when used with the unwind(8) backend.
dns-nxdomain
dns-nodata
dns-refused
dns-null
Debugging options:
print-debug
Utility options:
The following URL fetch utilities are supported and unless overridden by specifying one of the options below, will be used in the following order of preference if found on the system: aria2c, wget, curl, fetch, ftp.
The following grep(1) utilities are supported and unless overridden by specifying one of the options below, will be used in the following order of preference if found on the system: ripgrep, ugrep, ggrep, grep.
The following awk(1) utilities are supported and unless overridden by specifying one of the options below, will be used in the following order of preference if found on the system: mawk, gawk, goawk, awk.
The unbound-adblock
utility exits 0
on success, and >0 if an error occurs.
Check configuration validity:
$ unbound-adblock -nC /etc/unbound-adblock.conf
Fetch and process blocklist URLs from local list in bulk and export aggregated RPZ blocklist to stdout:
$ unbound-adblock -xl /var/db/urls.txt
Specify list of custom whitelist rules and blocklist URLs:
$ unbound-adblock -w /var/db/whitelist.txt -l /var/db/urls.txt
Specify individual whitelist rules and blocklist URLs:
$ unbound-adblock -r example.com -u https://example.com/file.txt
Specify custom backend with custom response code:
$ unbound-adblock -o unbound -o dns-refused
Disable all checks, logging and printing of warnings:
$ unbound-adblock -DV -o no-strict -o no-log
Feed blocklist to unwind(8) instead of Unbound:
$ unbound-adblock -o unwind
unbound-adblock
supports RPZ, which is a
widely adopted standard for implementing DNS filtering. Any DNS server
supporting RPZ should be compatible with the
unbound-adblock
generated RPZ data.
unbound-adblock
does not conform to the
POSIX shell spec, but instead aims for ksh(1)
compatibility. Any shell supporting typeset, ksh(1) array
and double bracket syntax should work fine.
unbound-adblock
has been confirmed to run
on the following shells:
Jordan Geoghegan <jordan@geoghegan.ca>
Whitelisting is only supported for RPZ and unbound(8) local-data backends.
DNS daemon reload is currently only supported for unbound(8) and unwind(8).
The unwind(8) backend does not support wildcards, whitelisting or custom DNS return codes.
October 28, 2021 | OpenBSD 7.0 |