summarylogtreecommitdiffstats
path: root/hostsblock.conf
blob: 1f001f279317772df2be9dc635cb26263aff26f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# CACHE DIRECTORY. Directory where blocklists will be downloaded and stored.

#cachedir="$HOME/cache" # DEFAULT

# WORK DIRECTORY. Temporary directory where interim files will be unzipped and
# processed. This directory will be deleted after hostsblock completes itself.

#tmpdir="/tmp/hostsblock" # DEFAULT

# FINAL HOSTSFILE. Final hosts file that combines together all downloaded blocklists.
# By default, hostsblock CANNOT directly write to /etc/hosts (See postprocess())
# below.

#hostsfile="$HOME/hosts.block" # DEFAULT. If not using a dns caching daemon

# REDIRECT URL. Url to which blocked hosts will be redirect, either 0.0.0.0 or
# 127.0.0.1. This replaces any entries to 0.0.0.0 and 127.0.0.1. If you run a
# pixelserver such as pixelserv or kwakd, it is advisable to use 127.0.0.1.

#redirecturl="127.0.0.1" # DEFAULT

# ALLOW REDIRECTS. Give "1" here to allow entries from blocklists that redirect
# rather than just block. Redirects present a certain security hazard, so make
# sure that you trust your blocklist providers if you give "1" here. Redirects
# allow those who have corrupted DNS servers to access sites not available
# otherwise.

#redirects="0" # DEFAULT

# POSTPROCESSING. Commands to run after the new hostsfile has been
# created. You may restart your dns cacher here (see example).

# Default: Do nothing. This will NOT write to /etc/hosts.

#postprocess() {
#    true
#}

# Example 1: dnsmasq under systemd.
# If using dnsmasq under systemd, make sure you have the following
# line in /etc/dnsmasq.conf:
#
# addn-hosts=/var/lib/hostsblock/hosts.block
#
# Also make sure that the dnsmasq daemon has read priviledges
# for that file. For example, if dnsmasq runs under user
# "dnsmasq," add that user to the "hostsblock" group by
# typing the following in on the command line:
#
# sudo gpasswd -a dnsmasq hostsblock
#
# You will also have to give the user "hostsblock"
# sudo access to "/usr/bin/systemctl reload dnsmasq.service"
# Type the following:
#
# sudo visudo
#
# And then enter the following line at the bottom of the
# resulting document:
#
# hostsblock	ALL	=	(root)	NOPASSWD:/usr/bin/systemctl reload dnsmasq.service
#

#postprocess() {
#    sudo /usr/bin/systemctl reload dnsmasq.service
#}

# Example 2. Clobber /etc/hosts with $HOME/hosts.block. If not using a dns
# cacher, you may directly replace /etc/hosts with your generated file (by
# default at $HOME/hosts.block). Make sure you use the hostshead feature to
# preserve your original /etc/hosts file. We use "cp" here so that
# $HOME/hosts.block is preserved for hostsblock-urlcheck, recycling, and
# backup purposes. Add sudo permissions by typing at the command line:
#
# sudo visudo
#
# And then entering the following line at the bottom
# of the resulting document:
#
# hostsblock	ALL	=	(root)  NOPASSWD: /usr/bin/cp
#

#postprocess() {
#    sudo cp $_v $hostsfile /etc/hosts
#}

# HEAD FILE. File containing hosts file entries which you want at the beginning
# of the resultant hosts file, e.g. for loopback devices and IPv6 entries. Use
# your original /etc/hosts file here if you are writing your final blocklist to
# /etc/hosts so as to preserve your loopback devices. Give hostshead="0" to
# disable this feature. For those targeting /etc/hosts, it is advisable to copy
# their old /etc/hosts file to this file so as to preserve existing entries.

#hostshead="0" # DEFAULT

# BLACKLISTED SUBDOMAINS. File containing specific subdomains to blacklist which
# may not be in the downloaded blacklists. Be sure to provide not just the
# domain, e.g. "google.com", but also the specific subdomain a la
# "adwords.google.com" without quotations.

#blacklist="$HOME/black.list" # DEFAULT

# WHITELIST. File containing the specific subdomains to allow through that may
# be blocked by the downloaded blocklists. In this file, put a space in front of
# a string in order to let through that specific site (without quotations), e.g.
# " www.example.com" will unblock "http://www.example.com" but not
# "http://subdomain.example.com". Leave no space in front of the entry to
# unblock all subdomains that contain that string, e.g. ".dropbox.com" will let
# through "www.dropbox.com", "dl.www.dropbox.com", "foo.dropbox.com",
# "bar.dropbox.com", etc.

#whitelist="$HOME/white.list"

# CONNECT_TIMEOUT. Parameter passed to curl. Determines how long to try to
# connect to each blocklist url before giving up.

#connect_timeout=60 # DEFAULT

# RETRY. Parameter passed to curl. Number of times to retry connecting to
# each blocklist url before giving up.

#retry=0 # DEFAULT

# MAX SIMULTANEOUS DOWNLOADS. Hostsblock can check and download files in parallel.
# By default, it will attempt to check and download four files at a time.

#max_simultaneous_downloads=4 # DEFAULT

# BACKUP_OLD. Save old hosts.block file. Passing "0" or "no" here has hostsblock
# NOT backup the old hosts.block file. Passing "1" or "yes" creates a gzip-
# compressed copy of the old file

#backup_old="no" # DEFAULT

# RECYCLE_OLD. If, for some reason, new downloaded blocklists contain fewer
# entries than previous versions, this option allows hostsblock to recycle the
# old main blocklist (e.g. hosts.block) so that old entries are preserved. In
# effect, the old hosts.block file becomes another downloaded blocklist.
# 1 = hostsblock WILL recycle old hosts.block, 0 = hostsblock will NOT.

#recycle_old=0 # DEFAULT

# VERBOSITY is not configured on the command line with the "-q" or "-v"
# flags.

# ANNOTATE. File where hostsblock will save information on which blocklist files
# affect which urls. Needed for hostsblock-urlcheck. This file will be gzipped.

#annotate="$HOME/hostsblock.db.gz" # DEFAULT

# COMPRESSION OPTIONS. hostsblock makes extensive use of gzip. Add any
# additional arguments to the gzip or pigz command here.

# pigz_opt="" # DEFAULT
# gzip_opt="" # DEFAULT

# BLOCKLISTS. List all blocklists to be downloaded as an array.Files may be
# either plaintext, zip, or 7z files. Hostsblock will automatically
# identify zip and 7z files.

blocklists=(
## HIGHLY RECOMMENDED LISTS

    # DEFAULT. Identitical to 'http://hosts-file.net/download/hosts.zip'
    'http://support.it-mate.co.uk/downloads/HOSTS.txt'

    # anti-ad and anti-malware list (winhelp2002.mvps.org/hosts.htm)
    #'http://winhelp2002.mvps.org/hosts.zip'

    # anti-ad (pgl.yoyo.org/adservers/)
    #'http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&mimetype=plaintext'

    # hpHosts main anti-ad and anti-malware (hosts-file.net/)
    # Compressed version of 'http://support.it-mate.co.uk/downloads/HOSTS.txt'
    #'http://hosts-file.net/download/hosts.zip'

    # anti-malware (www.malwaredomainlist.com/)
    #'http://www.malwaredomainlist.com/hostslist/hosts.txt'

    # anti-ads-only version of hpHosts main list (hosts-file.net)
    #'http://hosts-file.net/ad_servers.txt'

## RECOMMENDED LISTS
    # hpHosts inter-release (hosts-file.net/)
    #'http://hosts-file.net/hphosts-partial.asp'

    # anti-malware (hostsfile.org/hosts.html)
    #'http://hostsfile.org/Downloads/BadHosts.unx.zip'

    # anti-ad (hostsfile.mine.nu)
    #'http://hostsfile.mine.nu/Hosts.zip'

    # anti-ad (sysctl.org/cameleon/)
    #'http://sysctl.org/cameleon/hosts'

## ANTI-CRYTPOMINING LISTS

    # anti-cryptomining in browser (github.com/hoshsadiq/adblock-nocoin-list)
    #'https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt'

    # anti-cryptomining from https://github.com/ZeroDot1/CoinBlockerLists
        # All domains
        #'https://raw.githubusercontent.com/ZeroDot1/CoinBlockerLists/master/hosts'

        # Optional domains
        #'https://raw.githubusercontent.com/ZeroDot1/CoinBlockerLists/master/hosts_optional'

        # Browser mining domains; prevents browser mining only
        #'https://raw.githubusercontent.com/ZeroDot1/CoinBlockerLists/master/hosts_browser'

## OPTIONAL LISTS
    # hpHosts for yahoo adservers (hosts-file.net/)
    #'http://hosts-file.net/download/yahoo_servers.zip'

    # another general-purpose anti-ad list
    #'http://adblock.mahakala.is/hosts'

    # supplemented version of someonewhocares.org list (https://nauscopio.wordpress.com/category/filtrado/)
    #'http://abp.mozilla-hispano.org/nauscopio/hosts.zip'

    # anti-trackers (very large and aggressive) (rlwpx.free.fr/WPFF)
    #'http://rlwpx.free.fr/WPFF/htrc.7z'

    # anti-ad (very large and aggressive) (rlwpx.free.fr/WPFF)
    #'http://rlwpx.free.fr/WPFF/hpub.7z'

    # anti-malware (very large and aggressive) (rlwpx.free.fr/WPFF)
    #'http://rlwpx.free.fr/WPFF/hrsk.7z'

    # anti-porn (very large) (rlwpx.free.fr/WPFF)
    #'http://rlwpx.free.fr/WPFF/hsex.7z'

    # miscellaneous sites to be blocked (rlwpx.free.fr/WPFF)
    #'http://rlwpx.free.fr/WPFF/hmis.7z'

    # relatively old lists (https://github.com/lewisje/jansal)
    #'https://raw.githubusercontent.com/lewisje/jansal/master/adblock/hostsbig'
    #'https://raw.githubusercontent.com/lewisje/jansal/master/adblock/hostsbk'
    #'https://raw.githubusercontent.com/lewisje/jansal/master/adblock/hostsbkp'
    #'https://raw.githubusercontent.com/lewisje/jansal/master/adblock/hostsrt'
    #'https://raw.githubusercontent.com/lewisje/jansal/master/adblock/hostsu'

    # general ad- and pop-up-blocker (https://sourceforge.net/projects/adzhosts/)
    #'https://downloads.sourceforge.net/project/adzhosts/AdZHosts.zip'

    # uncompressed version of 'https://downloads.sourceforge.net/project/adzhosts/AdZHosts.zip'
    #'https://downloads.sourceforge.net/project/adzhosts/HOSTS.txt'

## LISTS WITH REDIRECTIONS. Enable redirects="1" to enable, and also uncomment
    # redirections for phished sites (rlwpx.free.fr/WPFF)
    #'http://rlwpx.free.fr/WPFF/hblc.7z'
)

# If you have any additional lists, please post a bug report to
# https://github.com/gaenserich/hostsblock/issues