# 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' ## 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