Skip to content

vdbhb59/hosts

Repository files navigation

hosts

Curated hosts file with various domain blocks.

See "Source" below for credits and source list. Lot of hosts are based on my own digging and compatible with almost all kind of adblockers.

Use "this batch file" as the latest shell script for Windows.

This readme is cosmetically-duplicated in my parallel world.


Nightly/Daily builds

  • Daily builds of the hosts file is now implemented and can be directly found here.
  • Thanks to Ushma for the squashing, coding and nightly implementation. :)

Install hblock

Thanks to Héctor Molinero Fernández for his scriptures.

curl -o /tmp/hblock 'https://raw.githubusercontent.com/vdbhb59/hosts/master/hblock' \
&& echo '7AAAD0EF10133A83B8EC714B6B59513C4DFE12A4  /tmp/hblock' | shasum -c \
&& sudo mv /tmp/hblock /usr/local/bin/hblock \
&& sudo chown 0:0 /usr/local/bin/hblock \
&& sudo chmod 755 /usr/local/bin/hblock

Install systemd service and timer units

The following commands will schedule a daily update of the hosts file. See systemd-timers for more information.

curl -o '/tmp/hblock.#1' 'https://raw.githubusercontent.com/vdbhb59/hosts/master/hblock.{service,timer}' \
  && echo '08b736382cb9dfd39df1207a3e90b068f5325a41dc8254d83fde5d4540ba8b5b  /tmp/hblock.service' | shasum -c \
  && echo '87a7ba5067d4c565aca96659b0dce230471a6ba35fbce1d3e9d02b264da4dc38  /tmp/hblock.timer' | shasum -c \
  && sudo mv /tmp/hblock.{service,timer} /etc/systemd/system/ \
  && sudo chown 0:0 /etc/systemd/system/hblock.{service,timer} \
  && sudo chmod 644 /etc/systemd/system/hblock.{service,timer} \
  && sudo systemctl daemon-reload \
  && sudo systemctl enable hblock.timer \
  && sudo systemctl start hblock.timer

Modify default options with environment variables

To change the default options instead of modifying the original service it is possible to override its properties.

For example, to have multiple domains on the same line and enable regular expressions in the allow-list, create the file /etc/systemd/system/hblock.service.d/override.conf with the following content:

[Service]
Environment=HBLOCK_WRAP=20
Environment=HBLOCK_REGEX=true

Then reload the systemd configuration and start the service:

sudo systemctl daemon-reload
sudo systemctl start hblock.service

Check Shasum the actual way

(Thanks Alexis La Porte for this.) Organic: In terminal run:

For sha2: shasum -a 256 filename/path

For sha1:
shasum -a 1 filename/path

Use your eyeballs and compare by sight the expected hash and the computed hash in the terminal. Eye strain might ensue.

Artisanal & organic: Run the above commands. Copy the resulting shasum with Ctrl + C. In browser or file use Ctrl + F with your copied shasum; if you find a match, congrats your file is fine! If no match, your file might have been altered or tampered with.

Inorganic, man-made: Use shasum check command. Runs diff and prints results in terminal.

In terminal run:
echo 'your_expected_shasum_here_followed_by_a_space *name_of_file_to_check_after_asterisk' | shasum -c


Check hash algorithms: "MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512" via command prompt in Windows:

For default (sha1): certUtil -hashfile hosts

Place the algorithm you wish to check after the filename: certUtil -hashfile hosts MD2

certutil -hashfile hosts SHA256


Supported Operating Systems

Android: For non-rooted devices, these host files can be used with Virtual Hosts, Tracker Control, DNS66, Blokada, Personal DNS Filter or Nebulo. The above softwares are free and open-source ad-blockers.

For rooted devices, one can replace the default hosts file with the file of choice from here, after renaming the choice file to "hosts". Permissions should be rw-r--r-- / 644.

Otherwise, if one does not wish to add it manually, one can use this host file with AdAway, a free and open-source ad-blocker for Android.

Linux: An open-source host file manager called hBlock.

Mac OS: These host files can be used with gasmask.

Windows: Users for Windows would find it easy to use with Hostman, a software to manage host file.

In case the above is not working, you can try one of the following as well:

SwitchHosts or HostsFileEditor

Use installer hostsinstaller with administrative rights in Windows.

Use Optimizer for Windows (use Hosts option > Advanced editor function), the finest Windows Optimizer with/without administrative rights in Windows.


How to disable DNS CACHE services on Windows?

  1. Hit Win+R & type regedit & press enter.

  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache, and locate the "Start" registry key. Now change its value from 2 (Automatic) to 4 (Disabled)

  3. Restart computer once & now change your host file with bigger SIZE.


Usage guide

Virual Hosts

Launch Virtual Hosts > Click on the + (plus) sign at the bottom right of the screen > Click settings (gear) icon > Under "set net hosts url", click the "remote hosts url" > A new pop-up will open > Copy paste the below hosts file URL > Click OK > It will Show Downloading > Success (will list the number of hosts entries > Click back & done.

https://hosts.flossboxin.org.in/files/hosts

TrackerControl TC

Launch TC > Top Right "3 Dots Drop Down" > Settings > Advanced options > "Hosts file URL" > Click and then copy paste the below hosts file URL. Then click OK to save the URL and then click "update hosts file".

https://hosts.flossboxin.org.in/files/hosts

Blokada

Open Blokada > navigate to Hosts List > Click + button and then copy paste the below hosts file URL. Then press the Shield icon to activate.

https://hosts.flossboxin.org.in/files/hosts

DNS66

Open DNS66 > swipe to Hosts > Click + button and then copy paste the below hosts file URL. Then press the refresh icon on the top and press the start button.

https://hosts.flossboxin.org.in/files/hosts

Adaway

Open Adaway > go to Host Source > Click + button and then copy paste the below hosts file URL. Then Click enable ad blocking from the home menu.

https://hosts.flossboxin.org.in/files/hosts

DNS Filter

Open DNS Filter > Tap on Advanced Settings > Tap on Configure Filter Update > Create a new filter by tapping on the Pencil icon > Copy paste the below hosts file URL > Tap on Active circle there > Tap on the (✔️) icon > Tap on Configure filter update to hide the menu > Tap on Advanced Settings > Tap on Restart

https://hosts.flossboxin.org.in/files/hosts

Recommended Whitelist

  • Facebook main app
  • Facebook Lite Messenger

Recommended Apps

For those who still are hardcore fcbook (lol) users, you can try Frost from F-Droid. Frost for Facebook (A fast and extensive third party wrapper for Facebook.)

https://f-droid.org/app/com.pitchedapps.frost

For YT users, use NewPipe / SkyTube / FreeTubeApp. These are fully open sourced.

https://f-droid.org/app/org.schabi.newpipe
https://f-droid.org/app/free.rm.skytube.oss/
https://apt.izzysoft.de/fdroid/index/apk/io.freetubeapp.freetube

Sources

  • Trying to implement these sources.
  • Source lists for my hosts files:

FLOSSbOxIN | No-Amazon | Hectorm | Hosts Vietnam | Steven Black | PolishFiltersTeam | MetaMask | Bad-Boyz | AnudeepND | Badmojr | Easy List | Easy List-Privacy | Easy List-Cookie | Yous | YHosts | GBA-Samsung | GBA-YT | GBA | GBA-Xiaomi | GBA-Le-Eco | Idoo | XFiles-Stable | XFiles-FB | XFiles-SiteBlock | XFiles-UPD UBlock


  • Resultant Host File:

hosts


  • Credits:

vdbhb59 | FLOSSbOxIN No-Amazon | Easylist > Easylist | HBlock > Héctor Molinero Fernández | HostsVN > Bigdragon | Steven Black > Steven Black | GoodByeAds > Jerryn70 | KAD Hosts > PolishFiltersTeam | Ethereum Phishing > MetaMask | Badd-Boyz-Hosts > Mitchell Krog | CoinMiner > Anudeep | Pro Hosts (BadMojr) > Imre Kristoffer Eilertsen (Dandelion Sprout) | Master Hosts > Chayoung You | Master Hosts > Vokins | No-Google > Nick Spaargaren | YouTube Hosts > Ivan Verevkin | XFiles > Gioxx


License

Content of the hosts is licensed under a MIT License.