• Stars
    star
    303
  • Rank 137,655 (Top 3 %)
  • Language Batchfile
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Quickly and easily install, uninstall, and set up automatic updates for any of Steven Black's unified hosts files.

Say Thanks!

Unified Hosts AutoUpdate

Quickly and easily install, uninstall, and set up automatic updates for any of Steven Black's unified hosts files.

This AutoUpdate project is maintained by ScriptTiger: https://github.com/ScriptTiger/Unified-Hosts-AutoUpdate

The Unified Hosts project is maintained by Steven Black: https://github.com/StevenBlack/hosts

Further project contributors are noted with their contributions in the Unified Hosts data, both available online from Steven Black's project as well as in the data injected into the local hosts file by this script, as it is downloaded directly from Steven Black's most recently pre-generated Unified Hosts files.

You can download this repo from the below link to get started:
https://github.com/ScriptTiger/Unified-Hosts-AutoUpdate/archive/master.zip
If your script worked in the past but has stopped working since, please update your repo files and try again before posting a new issue.

Extract the contents to the same directory and run the Hosts_Update.cmd script. There is also an option to remove the Unified Hosts from your local hosts file. In the event critical changes are made to either the AutoUpdate repo or to the Unified Hosts repo, this script is also capable of automatically updating itself.

If you experience problems with performance or seemingly unrelated networking issues after running this script, please try adjusting your compression level to one that best suits your needs.

This script requires either BITS or PowerShell to function. While both are native to modern Microsoft Windows installations, there are also compatible versions which can be manually installed for older systems.

If you want to ignore or whitelist certain entries from the Unified Hosts and prevent them from appearing in your local hosts, just add them to the ignore.txt. These entries are made with literal expressions and can match all or only part of an entry. So if you want to only ignore one specific URL, it's better to put the whole line just in case. For example, if you want to ignore the www.google.com domain specifically, put this:
0.0.0.0 www.google.com
If you want to ignore all .de websites, you can simply put:
.de
If you want to ignore all subdomains of google.com, you can put:
.google.com
If you want to ignore all google subdomains in any top level domain:
.google.

If you would also like to manage custom hosts file entries with this script, you can do so using the custom.txt. As this script does not alter custom entries in the hosts file itself, this is simply an option to make things easier if you would prefer to manage custom entries this way rather than manually managing them in the hosts file.

Also, if you send your preferred URL to the script as a parameter, it will bypass all the prompts and automatically install/update the Unified Hosts in the local hosts file. This is useful for things like scheduling a task to update your Unified Hosts daily or weekly, etc. You can even update your hosts randomly throughout the day at certain times to switch between Unified Hosts to, for example, only allow social in the evenings or on the weekends. And if you would like to remove the Unified Hosts from your hosts file, you can just enter "remove" as the URL. If you do decide to make a scheduled task, also remember the account issuing the task must still have administrative privileges to be able to write to the local hosts file. You can optionally add your preferred compression level as a second parameter, as well, but this must always accompany a URL as the first parameter.

Because no backup of your local hosts file is needed, entries in the Unified Hosts relating to the localhost and other loopback addresses have been removed to prevent possible conflict with preexisting entries. No backup is needed because this script implements the Unified Hosts within opening and closing tags to clearly segment it from the user's preexisting entries and allow the script to know what area of the file to overwrite during an update or remove during removal.

If you are deploying the update script across an organization via a shared network location and group policies, edit the "VERSION" file by adding an X to the end of the version number like this:
1.10X
This will disable the script from checking for script updates and attempting to update itself. This does not affect updates to the hosts file or whatever scheduled tasks you may have in place, this strictly disables the Hosts_Update.cmd from updating itself within the shared network location which remote system accounts running the scheduled tasks may not have write access to.

By default, the script forces the command processor instance to close upon completion just to ensure you don't have an unattended command prompt with administrative permissions lingering where it's not needded. However, for debugging or other purposes you can send /DFC as an initial argument to prevent the command prompt from closing after script completion. For further debugging, please reference the following error code table.

By default, log entries are only kept from the most recent scheduled task in the log.txt within the script home directory. If script updates are disabled, there will be no automatic logging since the assumption is the script directory is read-only. However, to force persistent logging to the script directory, you can also send /LOG as an initial argument to force writing a persistent log that always logs everything and never clears the log. You also have the option of alternatively using /LOG:<file> to write a persistent log to a directory and file of your choosing, which is recommended to be set to a local machine directory for deployments across networks so that logs are not written to the shared script directory which should be read-only. If you choose to configure persistent logging, please remember that managing that logging and associated file sizes then becomes your own responsibility.

Please note, all initial arguments (/DFC,/LOG:<file>, etc.) must be placed before the URL and compression parameters (i.e. Hosts_update.cmd /DFC <URL>).

Decimal Error Code Hexadecimal Error Code Explanation
0 0x0 The operation completed successfully. (No errors)
1 0x1 Must be run with administrative permissions
2 0x2 "#### END UNIFIED HOSTS ####" not properly marked in hosts file
3 0x3 Hosts file is not properly marked
4 0x4 Currently disabled due to maintenance, please try again later
5 0x5 Your system cannot connect to GitHub
6 0x6 Neither BITS nor PowerShell installed
7 0x7 Download mechanism cannot connect to GitHub
8 0x8 Download failed
255 0xFF The script terminated unexpectedly

This script is in active development, so please share your feedback on what you like and don't like so we know what direction to take and don't inadvertently make things worse

For more ScriptTiger scripts and goodies, check out ScriptTiger's GitHub Pages website:
https://scripttiger.github.io/

Donate

Donate Monero (XMR): 441LBeQpcSbC1kgangHYkW8Tzo8cunWvtVK4M6QYMcAjdkMmfwe8XzDJr1c4kbLLn3NuZKxzpLTVsgFd7Jh28qipR5rXAjx

More Repositories

1

Hosts-BL

Simple tool to handle hosts file black lists that can remove comments, remove duplicates, compress to 9 domains per line, add IPv6 entries, as well as can convert black lists to multiple other black list formats compatible with other software.
Go
44
star
2

Windows-911

Curated list of FREE emergency resources when you find yourself in the inevitable pickle with Windows. PRs welcome!
28
star
3

scripttiger.github.io

GitHub Pages
HTML
16
star
4

Hosts-Conversions

Drag and drop a hosts file to convert it.
Batchfile
13
star
5

LuaJIT-For-Windows

LuaJIT For Windows packages LuaJIT, LuaRocks, a Mingw-w64 tool chain, and git for a modern and easy-to-use all-in-one Lua solution that can be distributed as a standard Lua environment for any Lua workflow running on a 64-bit Windows platform.
Batchfile
13
star
6

MAC-Address-Lookup

Tired of paying a subscription service to access an API to resolve MAC address OUI/vendor data? Just resolving locally and maintaining your own database with this project is faster, cheaper (FREE!), and more secure.
Batchfile
13
star
7

Microsoft-Updates

If you just got a fresh Windows 10 and you don't know why your Internet stopped working around the same time, try this. These are scripts to enable and disable Microsoft Updates, for people with slower connections or that otherwise want to manually control updates. *Make sure to run with administrative privileges!
Batchfile
11
star
8

CRLF-Normalizer

An LF to CRLF converter to convert any files in any directory to CRLF.
Batchfile
10
star
9

IP

Tired of paying a subscription service to access an API to resolve geoIP data? Look no further! Resolving locally and maintaining your own database is easier than ever. This repo is everything IP: 32-bit/128-bit calculations, ping monitoring across multiple nodes, IPv4/IPv6 network calculations, geoip lookups.
Batchfile
10
star
10

Repo-Search

Tool to instantly search all or specific files in any repo for keywords or phrases natively on windows extremely easily, with an option to output results to a file. Also invaluable for gamers!
Batchfile
10
star
11

UUID-Generate

This is a UUID (A.K.A. GUID) generator that generates standard UUIDs (i.e. f19b32ec-cfaf-32ee-35b9-37435f4bef3f) and stores the new UUID in the UUID environmental variable (i.e. %UUID% or !UUID!), outputs the UUID as standard output, and also copies the new UUID to your clipboard if you are running Windows Vista or later.
Batchfile
6
star
12

Streamers

Curated list of streaming service domains. PRs welcome!
6
star
13

Tor-Search

Quickly and easily search Tor exit nodes based on geodata securely and anonymously offline and instantly build node lists.
Batchfile
5
star
14

Microsoft-Shared-Networks

Need help navigating connection sharing on Microsoft Windows 10 with or without the Creators Update?
Batchfile
5
star
15

FLACSFX

FLACSFX is a minimal FLAC-to-WAV transcoder to transcode an embedded FLAC file to a WAV file. The FLAC file can either be embedded at build time using the embed.go or embedded later by appending a FLAC file to a stand-alone FLACSFX executable built with the sa.go.
Go
5
star
16

DualServer-AutoUpdate

Blacklist updater script for DualServer.
Batchfile
5
star
17

goIP

goIP is a Go package which validates, parses, and formats IPv4 and IPv6 addresses, as well as creates simple, lightweight structures to store and return common information about IPs which are well suited to be used in iteration.
Go
3
star
18

abc

ABC is a package for Go which can act as either a standard HTTP sequential downloader supporting streaming playback while downloading for supported "Web" videos (with supported players, such as VLC, MPlayer, ffplay, MPC-HC, etc.) and resume capabilities or as an arbitrary byte collector to download only arbitrary portions of files by manipulating the HTTP Range header as needed. ABC can easily be imported into any Go project and be implemented as Go routines to download arbitrary portions of files concurrently. The reference implementation of ABC launches a single instance of ABC, but can also be easily scripted for concurrency.
Go
3
star
19

.github

Default community health files
2
star
20

cmudict

Search scripts for the cmudict.
Batchfile
2
star
21

Randomness

Demonstrations in randomness and private/local functions. If you ever wanted to make a script game, you should definitely check this out!
Batchfile
2
star
22

GeoIP

A Java GUI client for the IP_Search REST API.
Java
2
star
23

TorMon

Simple Tor controller for those that just want a single simple stand-alone compiled executable rather than needing to go through Python with STEM or other similar overly complex managed scripted projects utilizing countless dependency packages just to open a simple socket connection.
Go
2
star
24

forex

A simple tool to quickly scrape and format current foreign exchange rates from Google. Provides an optional REST API to more easily integrate with tools such as the Microsoft Excel `QueryTables` function.
Go
2
star
25

TinyWinDL

This is a trivial downloader for Windows which is basically just a wrapper for URLDownloadToFileA. Being a trivial downloader, it does not attempt to recover from an error nor does it follow dynamic links, so all links should be static. Use cases for TinyWinDL are trivial files, such as small files storing non-critical settings or configurations, which are synchronized regularly and missing a synchronization here or there is not important.
Assembly
2
star
26

DAIDE-QuickStart

Replacement for the original `DAIDE QuickStart.exe`. This script helps you quickly and easily set up Diplomacy games, both local or networked games with any combination of bots and/or humans, with a variety of variants included.
Batchfile
2
star
27

TigerCap

TigerCap is an ffmpeg script to capture audio from an audio device and encode it to a WAV file. The purpose of TigerCap is to facilitate audio recording with as minimal a footprint as possible to produce the best possible encoding of the audio with minimal artifacts.
Batchfile
2
star
28

fasmgP

Collection of fasmg procedures which can be quickly included with any fasmg project to gain out-of-the box procedures for simple memory management, string manipulations, and more, with minimal abstractions and as few system calls as possible in favor of doing as much as possible internally as efficiently and intuitively as possible.
Assembly
2
star
29

ScriptTiger

Public profile repository
2
star
30

KanziSFX

KanziSFX is a minimal Kanzi decompressor to decompress an embedded Kanzi archive.
Go
2
star
31

Brutecycle

Cycles through any given character set in any given order and outputs to standard output or to a file. For larger data sets, like 128-bit MD5 hashes, 160-bit SHA-1, 256-bit SHA-256, etc., it is recommended to only do a couple character combinations at a time, unless you plan on having the script run for days on end uninterrupted.
Batchfile
2
star
32

FFmpeg-Scripts

Collection of assorted FFmpeg scripts. Scripts prefixed with `DD_` support dragging and dropping a file over the script, meaning they accept a single file path as an argument.
Batchfile
2
star
33

TorPanel

A small Java Tor controller widget that stays conveniently on top and out of the way with a minimal footprint while you go about your activities.
Java
1
star
34

oui_standardize

oui_standardize standardizes IEEE MAC address block files (CSV files) containing OUI records by importing an arbitrary number of said files, sorting them by MAC address prefix, and then outputting the results to standard output (stdout). Curly brackets are used as delimiters and multi-line fields are reduced to single lines in order to allow scripts to more easily parse the records with as little overhead as possible.
Go
1
star
35

mixerInG

Mixer in G is a PCM audio stream mixer written in pure Go using the go-audio framework and does not require binding to non-native libraries, such as SoX or FFmpeg, as other mixers do.
Go
1
star