~kota/mergehosts

Merge together several online or offline hosts files
add todo and mailing list to readme
update man page to represent current project state
update copyright header

clone

read-only
https://git.sr.ht/~kota/mergehosts
read/write
git@git.sr.ht:~kota/mergehosts

You can also use your local clone with git send-email.

#Mergehosts

Merge together several hosts files.

#Details

mergehosts takes an input of 1 or more online http(s) hosts files seperated with spaces and then returns a concatenated version with duplicates removed. Typically this would be run by cron to update the systems hosts file and provide system-wide adblocking and anti-tracking for all applications. It could also be used to generate individual hosts files for use with firejail or similar.

BSD 3-Clause. See LICENSE in this repo for details.

Below are a few popular hosts files to try out.

https://adaway.org/hosts.txt
https://someonewhocares.org/hosts/zero/hosts
https://hosts-file.net/ad_servers.txt
https://www.malwaredomainlist.com/hostslist/hosts.txt
http://winhelp2002.mvps.org/hosts.txt
https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
https://mirror.cedia.org.ec/malwaredomains/justdomains
https://mirror.cedia.org.ec/malwaredomains/immortal_domains.txt
https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt
https://feodotracker.abuse.ch/blocklist/?download=domainblocklist
https://zeustracker.abuse.ch/blocklist.php?download=baddomains

#Example

mergehosts /etc/hosts https://adaway.org/hosts.txt > /etc/hosts

#Build

Build dependencies

  • golang
  • make
  • sed
  • scdoc

make all

#Install

Optionally configure config.mk to specify a different install location. Defaults to /usr/local/

sudo make install

#Uninstall

sudo make uninstall

#Resources

Send patches and questions to ~kota/mergehosts@lists.sr.ht.

Bugs & todo here: ~kota/mergehosts