mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-10-05 06:11:13 +01:00
@@ -1,3 +1,4 @@
|
||||
myhosts
|
||||
whitelist
|
||||
readmeData.json
|
||||
hosts-*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
#Unified hosts file with gambling, porn, social extensions
|
||||
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a unified hosts file
|
||||
with duplicates removed. This repo provides several hosts files tailored to you need to block.
|
||||
|
||||
* Last updated: **June 04 2016**.
|
||||
* Here's the [raw hosts file with gambling, porn, social extensions](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts) containing 33,267 entries.
|
||||
|
||||
### List of all hosts file variants
|
||||
|
||||
Host file recipe | Readme | Raw hosts | Unique domains
|
||||
---------------- |:------:|:---------:|:-------------:
|
||||
Unified hosts = **(adware + malware)** | [Readme](https://github.com/StevenBlack/hosts/blob/master/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) | 27,050
|
||||
Unified hosts **+ gambling** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts) | 27,764
|
||||
Unified hosts **+ porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts) | 32,323
|
||||
Unified hosts **+ social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts) | 27,280
|
||||
Unified hosts **+ gambling + porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts) | 33,037
|
||||
Unified hosts **+ gambling + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-social/hosts) | 27,994
|
||||
Unified hosts **+ porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn-social/hosts) | 32,553
|
||||
Unified hosts **+ gambling + porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts) | 33,267
|
||||
|
||||
|
||||
**Expectation**: These unified hosts files should serve all devices, regardless of OS.
|
||||
|
||||
## Sources of hosts data unified here
|
||||
|
||||
Updated `hosts` files from the following locations are always unified and included:
|
||||
|
||||
* The [Adaway hosts file](http://adaway.org/hosts.txt), updated regularly.
|
||||
* MVPs.org Hosts file at [http://winhelp2002.mvps.org/hosts.htm](http://winhelp2002.mvps.org/hosts.htm), updated
|
||||
monthly, or thereabouts.
|
||||
* Dan Pollock at [http://someonewhocares.org/hosts/](http://someonewhocares.org/hosts/) updated regularly.
|
||||
* Malware Domain List at [http://www.malwaredomainlist.com/](http://www.malwaredomainlist.com/), updated regularly.
|
||||
* Peter Lowe at [http://pgl.yoyo.org/adservers/](http://pgl.yoyo.org/adservers/), updated regularly.
|
||||
* My own small list in raw form [here](https://raw.github.com/StevenBlack/hosts/master/data/StevenBlack/hosts).
|
||||
|
||||
## Extensions
|
||||
The unified hosts file is extensible. You manage extensions by curating the `extensions/` folder tree.
|
||||
See the `social`, `gambling`, and `porn` extension which are included in this repo, for example.
|
||||
|
||||
## Generate your own unified hosts file
|
||||
|
||||
The `updateHostsFile.py` script, which is python 2.7 and Python 3-compatible, will generate a unified hosts file
|
||||
based on the sources in the local `data/` subfolder. The script will prompt you Whether it should fetch updated
|
||||
versions (from locations defined by the update.info text file in each source's folder), otherwise it will use the
|
||||
`hosts` file that's already there.
|
||||
|
||||
### Usage
|
||||
|
||||
#### Using Python 3:
|
||||
|
||||
python3 updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Using Python 2.7:
|
||||
|
||||
python updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Command line options:
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
`--auto`, or `-a`: run the script without prompting. When `--auto` is invoked,
|
||||
|
||||
* Hosts data sources, including extensions, are updated.
|
||||
* No extensions are included by default. Use the `--extensions` or `-e` flag to include any you want.
|
||||
* Your active hosts file is *not* replaced unless you include the `--replace` flag.
|
||||
|
||||
`--backup`, or `-b`: Make a backup of existing hosts file(s) as you generate over them.
|
||||
|
||||
`--extensions <ext1> <ext2> <ext3>`, or `-e <ext1> <ext2> <ext3>`: the names of subfolders below the `extensions` folder
|
||||
containing additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or
|
||||
`-e social porn`.
|
||||
|
||||
`--ip nnn.nnn.nnn.nnn`, or `-i nnn.nnn.nnn.nnn`: the IP address to use as the target. Default is `0.0.0.0`.
|
||||
|
||||
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
|
||||
|
||||
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file in a subfolder. If the subfolder does not
|
||||
exist, it will be created.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts
|
||||
|
||||
`--skipstatichosts`, or `-s`: `false` (default) or `true`, omit the standard section, at the top containing lines like `127.0.0.1 localhost`. This is useful for configuring proximate DNS services on the local network.
|
||||
|
||||
|
||||
## How do I control which sources are unified?
|
||||
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
`update.info` file.
|
||||
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
`update.info` controls where this extension finds its updates.
|
||||
|
||||
### How do I include my own custom domain mappings?
|
||||
|
||||
If you have custom hosts records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
unified hosts file during the update process.
|
||||
|
||||
The `myhosts` file is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo from `origin` in the future.
|
||||
|
||||
### How do I prevent domains from being included?
|
||||
|
||||
The domains you list in the `whitelist` file are excluded from the final hosts file.
|
||||
|
||||
The `whitelist` uses partial matching. Therefore if you whitelist `google-analytics.com`, that domain and all its
|
||||
subdomains won't be merged into the final hosts file.
|
||||
|
||||
The `whitelist` is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo
|
||||
from `origin` in the future.
|
||||
|
||||
|
||||
## What is a hosts file?
|
||||
|
||||
A hosts file, named `hosts` (with no file extension), is a plain-text file used by all operating
|
||||
systems to map hostnames to IP addresses.
|
||||
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a domain name is
|
||||
resolved by the `hosts` file, the request never leaves your computer.
|
||||
|
||||
Having a smart `hosts` file goes a long way towards blocking malware, adware, and other irritants.
|
||||
|
||||
For example, to nullify requests to some doubleclick.net servers, adding these lines to your hosts
|
||||
file will do it:
|
||||
|
||||
# block doubleClick's servers
|
||||
127.0.0.1 ad.ae.doubleclick.net
|
||||
127.0.0.1 ad.ar.doubleclick.net
|
||||
127.0.0.1 ad.at.doubleclick.net
|
||||
127.0.0.1 ad.au.doubleclick.net
|
||||
127.0.0.1 ad.be.doubleclick.net
|
||||
# etc...
|
||||
|
||||
|
||||
## We recommend using `0.0.0.0` instead of `127.0.0.1`
|
||||
Using `0.0.0.0` is faster because you don't have to wait for a timeout. It also does not interfere
|
||||
with a web server that may be running on the local PC.
|
||||
|
||||
## Why not use just `0` instead of `0.0.0.0`?
|
||||
We tried that. Using `0` doesn't work universally.
|
||||
|
||||
|
||||
## Location of your hosts file
|
||||
To modify your current `hosts` file, look for it in the following places and modify it with a text
|
||||
editor.
|
||||
|
||||
**Mac OS X, iOS, Android, Linux**: `/etc/hosts` folder.
|
||||
|
||||
**Windows**: `%SystemRoot%\system32\drivers\etc\hosts` folder.
|
||||
|
||||
## Reloading hosts file
|
||||
Your operating system will cache DNS lookups. You can either reboot or run the following commands to
|
||||
manually flush your DNS cache once the new hosts file is in place.
|
||||
|
||||
### Mac OS X
|
||||
Open a Terminal and run:
|
||||
|
||||
`sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder`
|
||||
|
||||
### Windows
|
||||
Open a Command Prompt:
|
||||
|
||||
**Windows XP**: Start -> Run -> `cmd`
|
||||
|
||||
**Windows Vista, 7**: Start Button -> type `cmd` -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
**Windows 8**: Start -> Swipe Up -> All Apps -> Windows System -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
and run:
|
||||
|
||||
`ipconfig /flushdns`
|
||||
|
||||
### Linux
|
||||
Open a Terminal and run with root privileges:
|
||||
|
||||
**Debian/Ubuntu** `sudo /etc/rc.d/init.d/nscd restart`
|
||||
|
||||
**Linux with systemd**: `sudo systemctl restart network.service`
|
||||
|
||||
**Fedora Linux**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Network Manager**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Wicd**: `sudo systemctl restart wicd.service`
|
||||
|
||||
**Others**: Consult [this wikipedia article](https://en.wikipedia.org/wiki/Hosts_%28file%29#Location_in_the_file_system).
|
||||
|
||||
|
||||
## Goals of this unified hosts file
|
||||
|
||||
The goals of this repo are to:
|
||||
|
||||
1. automatically combine high-quality lists of hosts,
|
||||
|
||||
2. provide easy extensions,
|
||||
|
||||
3. de-dupe the resultant combined list,
|
||||
|
||||
4. and keep the resultant file reasonably sized.
|
||||
|
||||
A high-quality source is defined here as one that is actively curated. A hosts source should be frequently
|
||||
updated by its maintainers with both additions and removals. The larger the hosts file, the higher the level of
|
||||
curation is expected.
|
||||
|
||||
For example, the (huge) hosts file from [hosts-file.net](http://hosts-file.net) is **not** included
|
||||
here because it is very large (300,000+ entries) and doesn't currently display a corresponding high level of curation
|
||||
activity.
|
||||
|
||||
It is expected that this unified hosts file will serve both desktop and mobile devices under a variety of operating
|
||||
systems.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
#Unified hosts file with gambling, porn extensions
|
||||
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a unified hosts file
|
||||
with duplicates removed. This repo provides several hosts files tailored to you need to block.
|
||||
|
||||
* Last updated: **June 04 2016**.
|
||||
* Here's the [raw hosts file with gambling, porn extensions](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts) containing 33,037 entries.
|
||||
|
||||
### List of all hosts file variants
|
||||
|
||||
Host file recipe | Readme | Raw hosts | Unique domains
|
||||
---------------- |:------:|:---------:|:-------------:
|
||||
Unified hosts = **(adware + malware)** | [Readme](https://github.com/StevenBlack/hosts/blob/master/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) | 27,050
|
||||
Unified hosts **+ gambling** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts) | 27,764
|
||||
Unified hosts **+ porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts) | 32,323
|
||||
Unified hosts **+ social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts) | 27,280
|
||||
Unified hosts **+ gambling + porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts) | 33,037
|
||||
Unified hosts **+ gambling + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-social/hosts) | 27,994
|
||||
Unified hosts **+ porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn-social/hosts) | 32,553
|
||||
Unified hosts **+ gambling + porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts) | 33,267
|
||||
|
||||
|
||||
**Expectation**: These unified hosts files should serve all devices, regardless of OS.
|
||||
|
||||
## Sources of hosts data unified here
|
||||
|
||||
Updated `hosts` files from the following locations are always unified and included:
|
||||
|
||||
* The [Adaway hosts file](http://adaway.org/hosts.txt), updated regularly.
|
||||
* MVPs.org Hosts file at [http://winhelp2002.mvps.org/hosts.htm](http://winhelp2002.mvps.org/hosts.htm), updated
|
||||
monthly, or thereabouts.
|
||||
* Dan Pollock at [http://someonewhocares.org/hosts/](http://someonewhocares.org/hosts/) updated regularly.
|
||||
* Malware Domain List at [http://www.malwaredomainlist.com/](http://www.malwaredomainlist.com/), updated regularly.
|
||||
* Peter Lowe at [http://pgl.yoyo.org/adservers/](http://pgl.yoyo.org/adservers/), updated regularly.
|
||||
* My own small list in raw form [here](https://raw.github.com/StevenBlack/hosts/master/data/StevenBlack/hosts).
|
||||
|
||||
## Extensions
|
||||
The unified hosts file is extensible. You manage extensions by curating the `extensions/` folder tree.
|
||||
See the `social`, `gambling`, and `porn` extension which are included in this repo, for example.
|
||||
|
||||
## Generate your own unified hosts file
|
||||
|
||||
The `updateHostsFile.py` script, which is python 2.7 and Python 3-compatible, will generate a unified hosts file
|
||||
based on the sources in the local `data/` subfolder. The script will prompt you Whether it should fetch updated
|
||||
versions (from locations defined by the update.info text file in each source's folder), otherwise it will use the
|
||||
`hosts` file that's already there.
|
||||
|
||||
### Usage
|
||||
|
||||
#### Using Python 3:
|
||||
|
||||
python3 updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Using Python 2.7:
|
||||
|
||||
python updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Command line options:
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
`--auto`, or `-a`: run the script without prompting. When `--auto` is invoked,
|
||||
|
||||
* Hosts data sources, including extensions, are updated.
|
||||
* No extensions are included by default. Use the `--extensions` or `-e` flag to include any you want.
|
||||
* Your active hosts file is *not* replaced unless you include the `--replace` flag.
|
||||
|
||||
`--backup`, or `-b`: Make a backup of existing hosts file(s) as you generate over them.
|
||||
|
||||
`--extensions <ext1> <ext2> <ext3>`, or `-e <ext1> <ext2> <ext3>`: the names of subfolders below the `extensions` folder
|
||||
containing additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or
|
||||
`-e social porn`.
|
||||
|
||||
`--ip nnn.nnn.nnn.nnn`, or `-i nnn.nnn.nnn.nnn`: the IP address to use as the target. Default is `0.0.0.0`.
|
||||
|
||||
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
|
||||
|
||||
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file in a subfolder. If the subfolder does not
|
||||
exist, it will be created.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts
|
||||
|
||||
`--skipstatichosts`, or `-s`: `false` (default) or `true`, omit the standard section, at the top containing lines like `127.0.0.1 localhost`. This is useful for configuring proximate DNS services on the local network.
|
||||
|
||||
|
||||
## How do I control which sources are unified?
|
||||
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
`update.info` file.
|
||||
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
`update.info` controls where this extension finds its updates.
|
||||
|
||||
### How do I include my own custom domain mappings?
|
||||
|
||||
If you have custom hosts records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
unified hosts file during the update process.
|
||||
|
||||
The `myhosts` file is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo from `origin` in the future.
|
||||
|
||||
### How do I prevent domains from being included?
|
||||
|
||||
The domains you list in the `whitelist` file are excluded from the final hosts file.
|
||||
|
||||
The `whitelist` uses partial matching. Therefore if you whitelist `google-analytics.com`, that domain and all its
|
||||
subdomains won't be merged into the final hosts file.
|
||||
|
||||
The `whitelist` is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo
|
||||
from `origin` in the future.
|
||||
|
||||
|
||||
## What is a hosts file?
|
||||
|
||||
A hosts file, named `hosts` (with no file extension), is a plain-text file used by all operating
|
||||
systems to map hostnames to IP addresses.
|
||||
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a domain name is
|
||||
resolved by the `hosts` file, the request never leaves your computer.
|
||||
|
||||
Having a smart `hosts` file goes a long way towards blocking malware, adware, and other irritants.
|
||||
|
||||
For example, to nullify requests to some doubleclick.net servers, adding these lines to your hosts
|
||||
file will do it:
|
||||
|
||||
# block doubleClick's servers
|
||||
127.0.0.1 ad.ae.doubleclick.net
|
||||
127.0.0.1 ad.ar.doubleclick.net
|
||||
127.0.0.1 ad.at.doubleclick.net
|
||||
127.0.0.1 ad.au.doubleclick.net
|
||||
127.0.0.1 ad.be.doubleclick.net
|
||||
# etc...
|
||||
|
||||
|
||||
## We recommend using `0.0.0.0` instead of `127.0.0.1`
|
||||
Using `0.0.0.0` is faster because you don't have to wait for a timeout. It also does not interfere
|
||||
with a web server that may be running on the local PC.
|
||||
|
||||
## Why not use just `0` instead of `0.0.0.0`?
|
||||
We tried that. Using `0` doesn't work universally.
|
||||
|
||||
|
||||
## Location of your hosts file
|
||||
To modify your current `hosts` file, look for it in the following places and modify it with a text
|
||||
editor.
|
||||
|
||||
**Mac OS X, iOS, Android, Linux**: `/etc/hosts` folder.
|
||||
|
||||
**Windows**: `%SystemRoot%\system32\drivers\etc\hosts` folder.
|
||||
|
||||
## Reloading hosts file
|
||||
Your operating system will cache DNS lookups. You can either reboot or run the following commands to
|
||||
manually flush your DNS cache once the new hosts file is in place.
|
||||
|
||||
### Mac OS X
|
||||
Open a Terminal and run:
|
||||
|
||||
`sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder`
|
||||
|
||||
### Windows
|
||||
Open a Command Prompt:
|
||||
|
||||
**Windows XP**: Start -> Run -> `cmd`
|
||||
|
||||
**Windows Vista, 7**: Start Button -> type `cmd` -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
**Windows 8**: Start -> Swipe Up -> All Apps -> Windows System -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
and run:
|
||||
|
||||
`ipconfig /flushdns`
|
||||
|
||||
### Linux
|
||||
Open a Terminal and run with root privileges:
|
||||
|
||||
**Debian/Ubuntu** `sudo /etc/rc.d/init.d/nscd restart`
|
||||
|
||||
**Linux with systemd**: `sudo systemctl restart network.service`
|
||||
|
||||
**Fedora Linux**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Network Manager**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Wicd**: `sudo systemctl restart wicd.service`
|
||||
|
||||
**Others**: Consult [this wikipedia article](https://en.wikipedia.org/wiki/Hosts_%28file%29#Location_in_the_file_system).
|
||||
|
||||
|
||||
## Goals of this unified hosts file
|
||||
|
||||
The goals of this repo are to:
|
||||
|
||||
1. automatically combine high-quality lists of hosts,
|
||||
|
||||
2. provide easy extensions,
|
||||
|
||||
3. de-dupe the resultant combined list,
|
||||
|
||||
4. and keep the resultant file reasonably sized.
|
||||
|
||||
A high-quality source is defined here as one that is actively curated. A hosts source should be frequently
|
||||
updated by its maintainers with both additions and removals. The larger the hosts file, the higher the level of
|
||||
curation is expected.
|
||||
|
||||
For example, the (huge) hosts file from [hosts-file.net](http://hosts-file.net) is **not** included
|
||||
here because it is very large (300,000+ entries) and doesn't currently display a corresponding high level of curation
|
||||
activity.
|
||||
|
||||
It is expected that this unified hosts file will serve both desktop and mobile devices under a variety of operating
|
||||
systems.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
#Unified hosts file with gambling, social extensions
|
||||
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a unified hosts file
|
||||
with duplicates removed. This repo provides several hosts files tailored to you need to block.
|
||||
|
||||
* Last updated: **June 04 2016**.
|
||||
* Here's the [raw hosts file with gambling, social extensions](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-social/hosts) containing 27,994 entries.
|
||||
|
||||
### List of all hosts file variants
|
||||
|
||||
Host file recipe | Readme | Raw hosts | Unique domains
|
||||
---------------- |:------:|:---------:|:-------------:
|
||||
Unified hosts = **(adware + malware)** | [Readme](https://github.com/StevenBlack/hosts/blob/master/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) | 27,050
|
||||
Unified hosts **+ gambling** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts) | 27,764
|
||||
Unified hosts **+ porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts) | 32,323
|
||||
Unified hosts **+ social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts) | 27,280
|
||||
Unified hosts **+ gambling + porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts) | 33,037
|
||||
Unified hosts **+ gambling + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-social/hosts) | 27,994
|
||||
Unified hosts **+ porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn-social/hosts) | 32,553
|
||||
Unified hosts **+ gambling + porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts) | 33,267
|
||||
|
||||
|
||||
**Expectation**: These unified hosts files should serve all devices, regardless of OS.
|
||||
|
||||
## Sources of hosts data unified here
|
||||
|
||||
Updated `hosts` files from the following locations are always unified and included:
|
||||
|
||||
* The [Adaway hosts file](http://adaway.org/hosts.txt), updated regularly.
|
||||
* MVPs.org Hosts file at [http://winhelp2002.mvps.org/hosts.htm](http://winhelp2002.mvps.org/hosts.htm), updated
|
||||
monthly, or thereabouts.
|
||||
* Dan Pollock at [http://someonewhocares.org/hosts/](http://someonewhocares.org/hosts/) updated regularly.
|
||||
* Malware Domain List at [http://www.malwaredomainlist.com/](http://www.malwaredomainlist.com/), updated regularly.
|
||||
* Peter Lowe at [http://pgl.yoyo.org/adservers/](http://pgl.yoyo.org/adservers/), updated regularly.
|
||||
* My own small list in raw form [here](https://raw.github.com/StevenBlack/hosts/master/data/StevenBlack/hosts).
|
||||
|
||||
## Extensions
|
||||
The unified hosts file is extensible. You manage extensions by curating the `extensions/` folder tree.
|
||||
See the `social`, `gambling`, and `porn` extension which are included in this repo, for example.
|
||||
|
||||
## Generate your own unified hosts file
|
||||
|
||||
The `updateHostsFile.py` script, which is python 2.7 and Python 3-compatible, will generate a unified hosts file
|
||||
based on the sources in the local `data/` subfolder. The script will prompt you Whether it should fetch updated
|
||||
versions (from locations defined by the update.info text file in each source's folder), otherwise it will use the
|
||||
`hosts` file that's already there.
|
||||
|
||||
### Usage
|
||||
|
||||
#### Using Python 3:
|
||||
|
||||
python3 updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Using Python 2.7:
|
||||
|
||||
python updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Command line options:
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
`--auto`, or `-a`: run the script without prompting. When `--auto` is invoked,
|
||||
|
||||
* Hosts data sources, including extensions, are updated.
|
||||
* No extensions are included by default. Use the `--extensions` or `-e` flag to include any you want.
|
||||
* Your active hosts file is *not* replaced unless you include the `--replace` flag.
|
||||
|
||||
`--backup`, or `-b`: Make a backup of existing hosts file(s) as you generate over them.
|
||||
|
||||
`--extensions <ext1> <ext2> <ext3>`, or `-e <ext1> <ext2> <ext3>`: the names of subfolders below the `extensions` folder
|
||||
containing additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or
|
||||
`-e social porn`.
|
||||
|
||||
`--ip nnn.nnn.nnn.nnn`, or `-i nnn.nnn.nnn.nnn`: the IP address to use as the target. Default is `0.0.0.0`.
|
||||
|
||||
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
|
||||
|
||||
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file in a subfolder. If the subfolder does not
|
||||
exist, it will be created.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts
|
||||
|
||||
`--skipstatichosts`, or `-s`: `false` (default) or `true`, omit the standard section, at the top containing lines like `127.0.0.1 localhost`. This is useful for configuring proximate DNS services on the local network.
|
||||
|
||||
|
||||
## How do I control which sources are unified?
|
||||
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
`update.info` file.
|
||||
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
`update.info` controls where this extension finds its updates.
|
||||
|
||||
### How do I include my own custom domain mappings?
|
||||
|
||||
If you have custom hosts records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
unified hosts file during the update process.
|
||||
|
||||
The `myhosts` file is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo from `origin` in the future.
|
||||
|
||||
### How do I prevent domains from being included?
|
||||
|
||||
The domains you list in the `whitelist` file are excluded from the final hosts file.
|
||||
|
||||
The `whitelist` uses partial matching. Therefore if you whitelist `google-analytics.com`, that domain and all its
|
||||
subdomains won't be merged into the final hosts file.
|
||||
|
||||
The `whitelist` is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo
|
||||
from `origin` in the future.
|
||||
|
||||
|
||||
## What is a hosts file?
|
||||
|
||||
A hosts file, named `hosts` (with no file extension), is a plain-text file used by all operating
|
||||
systems to map hostnames to IP addresses.
|
||||
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a domain name is
|
||||
resolved by the `hosts` file, the request never leaves your computer.
|
||||
|
||||
Having a smart `hosts` file goes a long way towards blocking malware, adware, and other irritants.
|
||||
|
||||
For example, to nullify requests to some doubleclick.net servers, adding these lines to your hosts
|
||||
file will do it:
|
||||
|
||||
# block doubleClick's servers
|
||||
127.0.0.1 ad.ae.doubleclick.net
|
||||
127.0.0.1 ad.ar.doubleclick.net
|
||||
127.0.0.1 ad.at.doubleclick.net
|
||||
127.0.0.1 ad.au.doubleclick.net
|
||||
127.0.0.1 ad.be.doubleclick.net
|
||||
# etc...
|
||||
|
||||
|
||||
## We recommend using `0.0.0.0` instead of `127.0.0.1`
|
||||
Using `0.0.0.0` is faster because you don't have to wait for a timeout. It also does not interfere
|
||||
with a web server that may be running on the local PC.
|
||||
|
||||
## Why not use just `0` instead of `0.0.0.0`?
|
||||
We tried that. Using `0` doesn't work universally.
|
||||
|
||||
|
||||
## Location of your hosts file
|
||||
To modify your current `hosts` file, look for it in the following places and modify it with a text
|
||||
editor.
|
||||
|
||||
**Mac OS X, iOS, Android, Linux**: `/etc/hosts` folder.
|
||||
|
||||
**Windows**: `%SystemRoot%\system32\drivers\etc\hosts` folder.
|
||||
|
||||
## Reloading hosts file
|
||||
Your operating system will cache DNS lookups. You can either reboot or run the following commands to
|
||||
manually flush your DNS cache once the new hosts file is in place.
|
||||
|
||||
### Mac OS X
|
||||
Open a Terminal and run:
|
||||
|
||||
`sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder`
|
||||
|
||||
### Windows
|
||||
Open a Command Prompt:
|
||||
|
||||
**Windows XP**: Start -> Run -> `cmd`
|
||||
|
||||
**Windows Vista, 7**: Start Button -> type `cmd` -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
**Windows 8**: Start -> Swipe Up -> All Apps -> Windows System -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
and run:
|
||||
|
||||
`ipconfig /flushdns`
|
||||
|
||||
### Linux
|
||||
Open a Terminal and run with root privileges:
|
||||
|
||||
**Debian/Ubuntu** `sudo /etc/rc.d/init.d/nscd restart`
|
||||
|
||||
**Linux with systemd**: `sudo systemctl restart network.service`
|
||||
|
||||
**Fedora Linux**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Network Manager**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Wicd**: `sudo systemctl restart wicd.service`
|
||||
|
||||
**Others**: Consult [this wikipedia article](https://en.wikipedia.org/wiki/Hosts_%28file%29#Location_in_the_file_system).
|
||||
|
||||
|
||||
## Goals of this unified hosts file
|
||||
|
||||
The goals of this repo are to:
|
||||
|
||||
1. automatically combine high-quality lists of hosts,
|
||||
|
||||
2. provide easy extensions,
|
||||
|
||||
3. de-dupe the resultant combined list,
|
||||
|
||||
4. and keep the resultant file reasonably sized.
|
||||
|
||||
A high-quality source is defined here as one that is actively curated. A hosts source should be frequently
|
||||
updated by its maintainers with both additions and removals. The larger the hosts file, the higher the level of
|
||||
curation is expected.
|
||||
|
||||
For example, the (huge) hosts file from [hosts-file.net](http://hosts-file.net) is **not** included
|
||||
here because it is very large (300,000+ entries) and doesn't currently display a corresponding high level of curation
|
||||
activity.
|
||||
|
||||
It is expected that this unified hosts file will serve both desktop and mobile devices under a variety of operating
|
||||
systems.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
#Unified hosts file with gambling extensions
|
||||
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a unified hosts file
|
||||
with duplicates removed. This repo provides several hosts files tailored to you need to block.
|
||||
|
||||
* Last updated: **June 04 2016**.
|
||||
* Here's the [raw hosts file with gambling extensions](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts) containing 27,764 entries.
|
||||
|
||||
### List of all hosts file variants
|
||||
|
||||
Host file recipe | Readme | Raw hosts | Unique domains
|
||||
---------------- |:------:|:---------:|:-------------:
|
||||
Unified hosts = **(adware + malware)** | [Readme](https://github.com/StevenBlack/hosts/blob/master/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) | 27,050
|
||||
Unified hosts **+ gambling** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts) | 27,764
|
||||
Unified hosts **+ porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts) | 32,323
|
||||
Unified hosts **+ social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts) | 27,280
|
||||
Unified hosts **+ gambling + porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts) | 33,037
|
||||
Unified hosts **+ gambling + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-social/hosts) | 27,994
|
||||
Unified hosts **+ porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn-social/hosts) | 32,553
|
||||
Unified hosts **+ gambling + porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts) | 33,267
|
||||
|
||||
|
||||
**Expectation**: These unified hosts files should serve all devices, regardless of OS.
|
||||
|
||||
## Sources of hosts data unified here
|
||||
|
||||
Updated `hosts` files from the following locations are always unified and included:
|
||||
|
||||
* The [Adaway hosts file](http://adaway.org/hosts.txt), updated regularly.
|
||||
* MVPs.org Hosts file at [http://winhelp2002.mvps.org/hosts.htm](http://winhelp2002.mvps.org/hosts.htm), updated
|
||||
monthly, or thereabouts.
|
||||
* Dan Pollock at [http://someonewhocares.org/hosts/](http://someonewhocares.org/hosts/) updated regularly.
|
||||
* Malware Domain List at [http://www.malwaredomainlist.com/](http://www.malwaredomainlist.com/), updated regularly.
|
||||
* Peter Lowe at [http://pgl.yoyo.org/adservers/](http://pgl.yoyo.org/adservers/), updated regularly.
|
||||
* My own small list in raw form [here](https://raw.github.com/StevenBlack/hosts/master/data/StevenBlack/hosts).
|
||||
|
||||
## Extensions
|
||||
The unified hosts file is extensible. You manage extensions by curating the `extensions/` folder tree.
|
||||
See the `social`, `gambling`, and `porn` extension which are included in this repo, for example.
|
||||
|
||||
## Generate your own unified hosts file
|
||||
|
||||
The `updateHostsFile.py` script, which is python 2.7 and Python 3-compatible, will generate a unified hosts file
|
||||
based on the sources in the local `data/` subfolder. The script will prompt you Whether it should fetch updated
|
||||
versions (from locations defined by the update.info text file in each source's folder), otherwise it will use the
|
||||
`hosts` file that's already there.
|
||||
|
||||
### Usage
|
||||
|
||||
#### Using Python 3:
|
||||
|
||||
python3 updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Using Python 2.7:
|
||||
|
||||
python updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Command line options:
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
`--auto`, or `-a`: run the script without prompting. When `--auto` is invoked,
|
||||
|
||||
* Hosts data sources, including extensions, are updated.
|
||||
* No extensions are included by default. Use the `--extensions` or `-e` flag to include any you want.
|
||||
* Your active hosts file is *not* replaced unless you include the `--replace` flag.
|
||||
|
||||
`--backup`, or `-b`: Make a backup of existing hosts file(s) as you generate over them.
|
||||
|
||||
`--extensions <ext1> <ext2> <ext3>`, or `-e <ext1> <ext2> <ext3>`: the names of subfolders below the `extensions` folder
|
||||
containing additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or
|
||||
`-e social porn`.
|
||||
|
||||
`--ip nnn.nnn.nnn.nnn`, or `-i nnn.nnn.nnn.nnn`: the IP address to use as the target. Default is `0.0.0.0`.
|
||||
|
||||
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
|
||||
|
||||
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file in a subfolder. If the subfolder does not
|
||||
exist, it will be created.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts
|
||||
|
||||
`--skipstatichosts`, or `-s`: `false` (default) or `true`, omit the standard section, at the top containing lines like `127.0.0.1 localhost`. This is useful for configuring proximate DNS services on the local network.
|
||||
|
||||
|
||||
## How do I control which sources are unified?
|
||||
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
`update.info` file.
|
||||
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
`update.info` controls where this extension finds its updates.
|
||||
|
||||
### How do I include my own custom domain mappings?
|
||||
|
||||
If you have custom hosts records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
unified hosts file during the update process.
|
||||
|
||||
The `myhosts` file is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo from `origin` in the future.
|
||||
|
||||
### How do I prevent domains from being included?
|
||||
|
||||
The domains you list in the `whitelist` file are excluded from the final hosts file.
|
||||
|
||||
The `whitelist` uses partial matching. Therefore if you whitelist `google-analytics.com`, that domain and all its
|
||||
subdomains won't be merged into the final hosts file.
|
||||
|
||||
The `whitelist` is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo
|
||||
from `origin` in the future.
|
||||
|
||||
|
||||
## What is a hosts file?
|
||||
|
||||
A hosts file, named `hosts` (with no file extension), is a plain-text file used by all operating
|
||||
systems to map hostnames to IP addresses.
|
||||
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a domain name is
|
||||
resolved by the `hosts` file, the request never leaves your computer.
|
||||
|
||||
Having a smart `hosts` file goes a long way towards blocking malware, adware, and other irritants.
|
||||
|
||||
For example, to nullify requests to some doubleclick.net servers, adding these lines to your hosts
|
||||
file will do it:
|
||||
|
||||
# block doubleClick's servers
|
||||
127.0.0.1 ad.ae.doubleclick.net
|
||||
127.0.0.1 ad.ar.doubleclick.net
|
||||
127.0.0.1 ad.at.doubleclick.net
|
||||
127.0.0.1 ad.au.doubleclick.net
|
||||
127.0.0.1 ad.be.doubleclick.net
|
||||
# etc...
|
||||
|
||||
|
||||
## We recommend using `0.0.0.0` instead of `127.0.0.1`
|
||||
Using `0.0.0.0` is faster because you don't have to wait for a timeout. It also does not interfere
|
||||
with a web server that may be running on the local PC.
|
||||
|
||||
## Why not use just `0` instead of `0.0.0.0`?
|
||||
We tried that. Using `0` doesn't work universally.
|
||||
|
||||
|
||||
## Location of your hosts file
|
||||
To modify your current `hosts` file, look for it in the following places and modify it with a text
|
||||
editor.
|
||||
|
||||
**Mac OS X, iOS, Android, Linux**: `/etc/hosts` folder.
|
||||
|
||||
**Windows**: `%SystemRoot%\system32\drivers\etc\hosts` folder.
|
||||
|
||||
## Reloading hosts file
|
||||
Your operating system will cache DNS lookups. You can either reboot or run the following commands to
|
||||
manually flush your DNS cache once the new hosts file is in place.
|
||||
|
||||
### Mac OS X
|
||||
Open a Terminal and run:
|
||||
|
||||
`sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder`
|
||||
|
||||
### Windows
|
||||
Open a Command Prompt:
|
||||
|
||||
**Windows XP**: Start -> Run -> `cmd`
|
||||
|
||||
**Windows Vista, 7**: Start Button -> type `cmd` -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
**Windows 8**: Start -> Swipe Up -> All Apps -> Windows System -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
and run:
|
||||
|
||||
`ipconfig /flushdns`
|
||||
|
||||
### Linux
|
||||
Open a Terminal and run with root privileges:
|
||||
|
||||
**Debian/Ubuntu** `sudo /etc/rc.d/init.d/nscd restart`
|
||||
|
||||
**Linux with systemd**: `sudo systemctl restart network.service`
|
||||
|
||||
**Fedora Linux**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Network Manager**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Wicd**: `sudo systemctl restart wicd.service`
|
||||
|
||||
**Others**: Consult [this wikipedia article](https://en.wikipedia.org/wiki/Hosts_%28file%29#Location_in_the_file_system).
|
||||
|
||||
|
||||
## Goals of this unified hosts file
|
||||
|
||||
The goals of this repo are to:
|
||||
|
||||
1. automatically combine high-quality lists of hosts,
|
||||
|
||||
2. provide easy extensions,
|
||||
|
||||
3. de-dupe the resultant combined list,
|
||||
|
||||
4. and keep the resultant file reasonably sized.
|
||||
|
||||
A high-quality source is defined here as one that is actively curated. A hosts source should be frequently
|
||||
updated by its maintainers with both additions and removals. The larger the hosts file, the higher the level of
|
||||
curation is expected.
|
||||
|
||||
For example, the (huge) hosts file from [hosts-file.net](http://hosts-file.net) is **not** included
|
||||
here because it is very large (300,000+ entries) and doesn't currently display a corresponding high level of curation
|
||||
activity.
|
||||
|
||||
It is expected that this unified hosts file will serve both desktop and mobile devices under a variety of operating
|
||||
systems.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
#Unified hosts file with porn, social extensions
|
||||
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a unified hosts file
|
||||
with duplicates removed. This repo provides several hosts files tailored to you need to block.
|
||||
|
||||
* Last updated: **June 04 2016**.
|
||||
* Here's the [raw hosts file with porn, social extensions](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn-social/hosts) containing 32,553 entries.
|
||||
|
||||
### List of all hosts file variants
|
||||
|
||||
Host file recipe | Readme | Raw hosts | Unique domains
|
||||
---------------- |:------:|:---------:|:-------------:
|
||||
Unified hosts = **(adware + malware)** | [Readme](https://github.com/StevenBlack/hosts/blob/master/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) | 27,050
|
||||
Unified hosts **+ gambling** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts) | 27,764
|
||||
Unified hosts **+ porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts) | 32,323
|
||||
Unified hosts **+ social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts) | 27,280
|
||||
Unified hosts **+ gambling + porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts) | 33,037
|
||||
Unified hosts **+ gambling + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-social/hosts) | 27,994
|
||||
Unified hosts **+ porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn-social/hosts) | 32,553
|
||||
Unified hosts **+ gambling + porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts) | 33,267
|
||||
|
||||
|
||||
**Expectation**: These unified hosts files should serve all devices, regardless of OS.
|
||||
|
||||
## Sources of hosts data unified here
|
||||
|
||||
Updated `hosts` files from the following locations are always unified and included:
|
||||
|
||||
* The [Adaway hosts file](http://adaway.org/hosts.txt), updated regularly.
|
||||
* MVPs.org Hosts file at [http://winhelp2002.mvps.org/hosts.htm](http://winhelp2002.mvps.org/hosts.htm), updated
|
||||
monthly, or thereabouts.
|
||||
* Dan Pollock at [http://someonewhocares.org/hosts/](http://someonewhocares.org/hosts/) updated regularly.
|
||||
* Malware Domain List at [http://www.malwaredomainlist.com/](http://www.malwaredomainlist.com/), updated regularly.
|
||||
* Peter Lowe at [http://pgl.yoyo.org/adservers/](http://pgl.yoyo.org/adservers/), updated regularly.
|
||||
* My own small list in raw form [here](https://raw.github.com/StevenBlack/hosts/master/data/StevenBlack/hosts).
|
||||
|
||||
## Extensions
|
||||
The unified hosts file is extensible. You manage extensions by curating the `extensions/` folder tree.
|
||||
See the `social`, `gambling`, and `porn` extension which are included in this repo, for example.
|
||||
|
||||
## Generate your own unified hosts file
|
||||
|
||||
The `updateHostsFile.py` script, which is python 2.7 and Python 3-compatible, will generate a unified hosts file
|
||||
based on the sources in the local `data/` subfolder. The script will prompt you Whether it should fetch updated
|
||||
versions (from locations defined by the update.info text file in each source's folder), otherwise it will use the
|
||||
`hosts` file that's already there.
|
||||
|
||||
### Usage
|
||||
|
||||
#### Using Python 3:
|
||||
|
||||
python3 updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Using Python 2.7:
|
||||
|
||||
python updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Command line options:
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
`--auto`, or `-a`: run the script without prompting. When `--auto` is invoked,
|
||||
|
||||
* Hosts data sources, including extensions, are updated.
|
||||
* No extensions are included by default. Use the `--extensions` or `-e` flag to include any you want.
|
||||
* Your active hosts file is *not* replaced unless you include the `--replace` flag.
|
||||
|
||||
`--backup`, or `-b`: Make a backup of existing hosts file(s) as you generate over them.
|
||||
|
||||
`--extensions <ext1> <ext2> <ext3>`, or `-e <ext1> <ext2> <ext3>`: the names of subfolders below the `extensions` folder
|
||||
containing additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or
|
||||
`-e social porn`.
|
||||
|
||||
`--ip nnn.nnn.nnn.nnn`, or `-i nnn.nnn.nnn.nnn`: the IP address to use as the target. Default is `0.0.0.0`.
|
||||
|
||||
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
|
||||
|
||||
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file in a subfolder. If the subfolder does not
|
||||
exist, it will be created.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts
|
||||
|
||||
`--skipstatichosts`, or `-s`: `false` (default) or `true`, omit the standard section, at the top containing lines like `127.0.0.1 localhost`. This is useful for configuring proximate DNS services on the local network.
|
||||
|
||||
|
||||
## How do I control which sources are unified?
|
||||
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
`update.info` file.
|
||||
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
`update.info` controls where this extension finds its updates.
|
||||
|
||||
### How do I include my own custom domain mappings?
|
||||
|
||||
If you have custom hosts records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
unified hosts file during the update process.
|
||||
|
||||
The `myhosts` file is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo from `origin` in the future.
|
||||
|
||||
### How do I prevent domains from being included?
|
||||
|
||||
The domains you list in the `whitelist` file are excluded from the final hosts file.
|
||||
|
||||
The `whitelist` uses partial matching. Therefore if you whitelist `google-analytics.com`, that domain and all its
|
||||
subdomains won't be merged into the final hosts file.
|
||||
|
||||
The `whitelist` is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo
|
||||
from `origin` in the future.
|
||||
|
||||
|
||||
## What is a hosts file?
|
||||
|
||||
A hosts file, named `hosts` (with no file extension), is a plain-text file used by all operating
|
||||
systems to map hostnames to IP addresses.
|
||||
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a domain name is
|
||||
resolved by the `hosts` file, the request never leaves your computer.
|
||||
|
||||
Having a smart `hosts` file goes a long way towards blocking malware, adware, and other irritants.
|
||||
|
||||
For example, to nullify requests to some doubleclick.net servers, adding these lines to your hosts
|
||||
file will do it:
|
||||
|
||||
# block doubleClick's servers
|
||||
127.0.0.1 ad.ae.doubleclick.net
|
||||
127.0.0.1 ad.ar.doubleclick.net
|
||||
127.0.0.1 ad.at.doubleclick.net
|
||||
127.0.0.1 ad.au.doubleclick.net
|
||||
127.0.0.1 ad.be.doubleclick.net
|
||||
# etc...
|
||||
|
||||
|
||||
## We recommend using `0.0.0.0` instead of `127.0.0.1`
|
||||
Using `0.0.0.0` is faster because you don't have to wait for a timeout. It also does not interfere
|
||||
with a web server that may be running on the local PC.
|
||||
|
||||
## Why not use just `0` instead of `0.0.0.0`?
|
||||
We tried that. Using `0` doesn't work universally.
|
||||
|
||||
|
||||
## Location of your hosts file
|
||||
To modify your current `hosts` file, look for it in the following places and modify it with a text
|
||||
editor.
|
||||
|
||||
**Mac OS X, iOS, Android, Linux**: `/etc/hosts` folder.
|
||||
|
||||
**Windows**: `%SystemRoot%\system32\drivers\etc\hosts` folder.
|
||||
|
||||
## Reloading hosts file
|
||||
Your operating system will cache DNS lookups. You can either reboot or run the following commands to
|
||||
manually flush your DNS cache once the new hosts file is in place.
|
||||
|
||||
### Mac OS X
|
||||
Open a Terminal and run:
|
||||
|
||||
`sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder`
|
||||
|
||||
### Windows
|
||||
Open a Command Prompt:
|
||||
|
||||
**Windows XP**: Start -> Run -> `cmd`
|
||||
|
||||
**Windows Vista, 7**: Start Button -> type `cmd` -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
**Windows 8**: Start -> Swipe Up -> All Apps -> Windows System -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
and run:
|
||||
|
||||
`ipconfig /flushdns`
|
||||
|
||||
### Linux
|
||||
Open a Terminal and run with root privileges:
|
||||
|
||||
**Debian/Ubuntu** `sudo /etc/rc.d/init.d/nscd restart`
|
||||
|
||||
**Linux with systemd**: `sudo systemctl restart network.service`
|
||||
|
||||
**Fedora Linux**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Network Manager**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Wicd**: `sudo systemctl restart wicd.service`
|
||||
|
||||
**Others**: Consult [this wikipedia article](https://en.wikipedia.org/wiki/Hosts_%28file%29#Location_in_the_file_system).
|
||||
|
||||
|
||||
## Goals of this unified hosts file
|
||||
|
||||
The goals of this repo are to:
|
||||
|
||||
1. automatically combine high-quality lists of hosts,
|
||||
|
||||
2. provide easy extensions,
|
||||
|
||||
3. de-dupe the resultant combined list,
|
||||
|
||||
4. and keep the resultant file reasonably sized.
|
||||
|
||||
A high-quality source is defined here as one that is actively curated. A hosts source should be frequently
|
||||
updated by its maintainers with both additions and removals. The larger the hosts file, the higher the level of
|
||||
curation is expected.
|
||||
|
||||
For example, the (huge) hosts file from [hosts-file.net](http://hosts-file.net) is **not** included
|
||||
here because it is very large (300,000+ entries) and doesn't currently display a corresponding high level of curation
|
||||
activity.
|
||||
|
||||
It is expected that this unified hosts file will serve both desktop and mobile devices under a variety of operating
|
||||
systems.
|
||||
+34584
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
#Unified hosts file with porn extensions
|
||||
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a unified hosts file
|
||||
with duplicates removed. This repo provides several hosts files tailored to you need to block.
|
||||
|
||||
* Last updated: **June 04 2016**.
|
||||
* Here's the [raw hosts file with porn extensions](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts) containing 32,323 entries.
|
||||
|
||||
### List of all hosts file variants
|
||||
|
||||
Host file recipe | Readme | Raw hosts | Unique domains
|
||||
---------------- |:------:|:---------:|:-------------:
|
||||
Unified hosts = **(adware + malware)** | [Readme](https://github.com/StevenBlack/hosts/blob/master/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) | 27,050
|
||||
Unified hosts **+ gambling** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts) | 27,764
|
||||
Unified hosts **+ porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts) | 32,323
|
||||
Unified hosts **+ social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts) | 27,280
|
||||
Unified hosts **+ gambling + porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts) | 33,037
|
||||
Unified hosts **+ gambling + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-social/hosts) | 27,994
|
||||
Unified hosts **+ porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn-social/hosts) | 32,553
|
||||
Unified hosts **+ gambling + porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts) | 33,267
|
||||
|
||||
|
||||
**Expectation**: These unified hosts files should serve all devices, regardless of OS.
|
||||
|
||||
## Sources of hosts data unified here
|
||||
|
||||
Updated `hosts` files from the following locations are always unified and included:
|
||||
|
||||
* The [Adaway hosts file](http://adaway.org/hosts.txt), updated regularly.
|
||||
* MVPs.org Hosts file at [http://winhelp2002.mvps.org/hosts.htm](http://winhelp2002.mvps.org/hosts.htm), updated
|
||||
monthly, or thereabouts.
|
||||
* Dan Pollock at [http://someonewhocares.org/hosts/](http://someonewhocares.org/hosts/) updated regularly.
|
||||
* Malware Domain List at [http://www.malwaredomainlist.com/](http://www.malwaredomainlist.com/), updated regularly.
|
||||
* Peter Lowe at [http://pgl.yoyo.org/adservers/](http://pgl.yoyo.org/adservers/), updated regularly.
|
||||
* My own small list in raw form [here](https://raw.github.com/StevenBlack/hosts/master/data/StevenBlack/hosts).
|
||||
|
||||
## Extensions
|
||||
The unified hosts file is extensible. You manage extensions by curating the `extensions/` folder tree.
|
||||
See the `social`, `gambling`, and `porn` extension which are included in this repo, for example.
|
||||
|
||||
## Generate your own unified hosts file
|
||||
|
||||
The `updateHostsFile.py` script, which is python 2.7 and Python 3-compatible, will generate a unified hosts file
|
||||
based on the sources in the local `data/` subfolder. The script will prompt you Whether it should fetch updated
|
||||
versions (from locations defined by the update.info text file in each source's folder), otherwise it will use the
|
||||
`hosts` file that's already there.
|
||||
|
||||
### Usage
|
||||
|
||||
#### Using Python 3:
|
||||
|
||||
python3 updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Using Python 2.7:
|
||||
|
||||
python updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Command line options:
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
`--auto`, or `-a`: run the script without prompting. When `--auto` is invoked,
|
||||
|
||||
* Hosts data sources, including extensions, are updated.
|
||||
* No extensions are included by default. Use the `--extensions` or `-e` flag to include any you want.
|
||||
* Your active hosts file is *not* replaced unless you include the `--replace` flag.
|
||||
|
||||
`--backup`, or `-b`: Make a backup of existing hosts file(s) as you generate over them.
|
||||
|
||||
`--extensions <ext1> <ext2> <ext3>`, or `-e <ext1> <ext2> <ext3>`: the names of subfolders below the `extensions` folder
|
||||
containing additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or
|
||||
`-e social porn`.
|
||||
|
||||
`--ip nnn.nnn.nnn.nnn`, or `-i nnn.nnn.nnn.nnn`: the IP address to use as the target. Default is `0.0.0.0`.
|
||||
|
||||
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
|
||||
|
||||
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file in a subfolder. If the subfolder does not
|
||||
exist, it will be created.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts
|
||||
|
||||
`--skipstatichosts`, or `-s`: `false` (default) or `true`, omit the standard section, at the top containing lines like `127.0.0.1 localhost`. This is useful for configuring proximate DNS services on the local network.
|
||||
|
||||
|
||||
## How do I control which sources are unified?
|
||||
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
`update.info` file.
|
||||
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
`update.info` controls where this extension finds its updates.
|
||||
|
||||
### How do I include my own custom domain mappings?
|
||||
|
||||
If you have custom hosts records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
unified hosts file during the update process.
|
||||
|
||||
The `myhosts` file is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo from `origin` in the future.
|
||||
|
||||
### How do I prevent domains from being included?
|
||||
|
||||
The domains you list in the `whitelist` file are excluded from the final hosts file.
|
||||
|
||||
The `whitelist` uses partial matching. Therefore if you whitelist `google-analytics.com`, that domain and all its
|
||||
subdomains won't be merged into the final hosts file.
|
||||
|
||||
The `whitelist` is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo
|
||||
from `origin` in the future.
|
||||
|
||||
|
||||
## What is a hosts file?
|
||||
|
||||
A hosts file, named `hosts` (with no file extension), is a plain-text file used by all operating
|
||||
systems to map hostnames to IP addresses.
|
||||
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a domain name is
|
||||
resolved by the `hosts` file, the request never leaves your computer.
|
||||
|
||||
Having a smart `hosts` file goes a long way towards blocking malware, adware, and other irritants.
|
||||
|
||||
For example, to nullify requests to some doubleclick.net servers, adding these lines to your hosts
|
||||
file will do it:
|
||||
|
||||
# block doubleClick's servers
|
||||
127.0.0.1 ad.ae.doubleclick.net
|
||||
127.0.0.1 ad.ar.doubleclick.net
|
||||
127.0.0.1 ad.at.doubleclick.net
|
||||
127.0.0.1 ad.au.doubleclick.net
|
||||
127.0.0.1 ad.be.doubleclick.net
|
||||
# etc...
|
||||
|
||||
|
||||
## We recommend using `0.0.0.0` instead of `127.0.0.1`
|
||||
Using `0.0.0.0` is faster because you don't have to wait for a timeout. It also does not interfere
|
||||
with a web server that may be running on the local PC.
|
||||
|
||||
## Why not use just `0` instead of `0.0.0.0`?
|
||||
We tried that. Using `0` doesn't work universally.
|
||||
|
||||
|
||||
## Location of your hosts file
|
||||
To modify your current `hosts` file, look for it in the following places and modify it with a text
|
||||
editor.
|
||||
|
||||
**Mac OS X, iOS, Android, Linux**: `/etc/hosts` folder.
|
||||
|
||||
**Windows**: `%SystemRoot%\system32\drivers\etc\hosts` folder.
|
||||
|
||||
## Reloading hosts file
|
||||
Your operating system will cache DNS lookups. You can either reboot or run the following commands to
|
||||
manually flush your DNS cache once the new hosts file is in place.
|
||||
|
||||
### Mac OS X
|
||||
Open a Terminal and run:
|
||||
|
||||
`sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder`
|
||||
|
||||
### Windows
|
||||
Open a Command Prompt:
|
||||
|
||||
**Windows XP**: Start -> Run -> `cmd`
|
||||
|
||||
**Windows Vista, 7**: Start Button -> type `cmd` -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
**Windows 8**: Start -> Swipe Up -> All Apps -> Windows System -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
and run:
|
||||
|
||||
`ipconfig /flushdns`
|
||||
|
||||
### Linux
|
||||
Open a Terminal and run with root privileges:
|
||||
|
||||
**Debian/Ubuntu** `sudo /etc/rc.d/init.d/nscd restart`
|
||||
|
||||
**Linux with systemd**: `sudo systemctl restart network.service`
|
||||
|
||||
**Fedora Linux**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Network Manager**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Wicd**: `sudo systemctl restart wicd.service`
|
||||
|
||||
**Others**: Consult [this wikipedia article](https://en.wikipedia.org/wiki/Hosts_%28file%29#Location_in_the_file_system).
|
||||
|
||||
|
||||
## Goals of this unified hosts file
|
||||
|
||||
The goals of this repo are to:
|
||||
|
||||
1. automatically combine high-quality lists of hosts,
|
||||
|
||||
2. provide easy extensions,
|
||||
|
||||
3. de-dupe the resultant combined list,
|
||||
|
||||
4. and keep the resultant file reasonably sized.
|
||||
|
||||
A high-quality source is defined here as one that is actively curated. A hosts source should be frequently
|
||||
updated by its maintainers with both additions and removals. The larger the hosts file, the higher the level of
|
||||
curation is expected.
|
||||
|
||||
For example, the (huge) hosts file from [hosts-file.net](http://hosts-file.net) is **not** included
|
||||
here because it is very large (300,000+ entries) and doesn't currently display a corresponding high level of curation
|
||||
activity.
|
||||
|
||||
It is expected that this unified hosts file will serve both desktop and mobile devices under a variety of operating
|
||||
systems.
|
||||
+29554
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
#Unified hosts file with social extensions
|
||||
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a unified hosts file
|
||||
with duplicates removed. This repo provides several hosts files tailored to you need to block.
|
||||
|
||||
* Last updated: **June 04 2016**.
|
||||
* Here's the [raw hosts file with social extensions](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts) containing 27,280 entries.
|
||||
|
||||
### List of all hosts file variants
|
||||
|
||||
Host file recipe | Readme | Raw hosts | Unique domains
|
||||
---------------- |:------:|:---------:|:-------------:
|
||||
Unified hosts = **(adware + malware)** | [Readme](https://github.com/StevenBlack/hosts/blob/master/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) | 27,050
|
||||
Unified hosts **+ gambling** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts) | 27,764
|
||||
Unified hosts **+ porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts) | 32,323
|
||||
Unified hosts **+ social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts) | 27,280
|
||||
Unified hosts **+ gambling + porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts) | 33,037
|
||||
Unified hosts **+ gambling + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-social/hosts) | 27,994
|
||||
Unified hosts **+ porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn-social/hosts) | 32,553
|
||||
Unified hosts **+ gambling + porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts) | 33,267
|
||||
|
||||
|
||||
**Expectation**: These unified hosts files should serve all devices, regardless of OS.
|
||||
|
||||
## Sources of hosts data unified here
|
||||
|
||||
Updated `hosts` files from the following locations are always unified and included:
|
||||
|
||||
* The [Adaway hosts file](http://adaway.org/hosts.txt), updated regularly.
|
||||
* MVPs.org Hosts file at [http://winhelp2002.mvps.org/hosts.htm](http://winhelp2002.mvps.org/hosts.htm), updated
|
||||
monthly, or thereabouts.
|
||||
* Dan Pollock at [http://someonewhocares.org/hosts/](http://someonewhocares.org/hosts/) updated regularly.
|
||||
* Malware Domain List at [http://www.malwaredomainlist.com/](http://www.malwaredomainlist.com/), updated regularly.
|
||||
* Peter Lowe at [http://pgl.yoyo.org/adservers/](http://pgl.yoyo.org/adservers/), updated regularly.
|
||||
* My own small list in raw form [here](https://raw.github.com/StevenBlack/hosts/master/data/StevenBlack/hosts).
|
||||
|
||||
## Extensions
|
||||
The unified hosts file is extensible. You manage extensions by curating the `extensions/` folder tree.
|
||||
See the `social`, `gambling`, and `porn` extension which are included in this repo, for example.
|
||||
|
||||
## Generate your own unified hosts file
|
||||
|
||||
The `updateHostsFile.py` script, which is python 2.7 and Python 3-compatible, will generate a unified hosts file
|
||||
based on the sources in the local `data/` subfolder. The script will prompt you Whether it should fetch updated
|
||||
versions (from locations defined by the update.info text file in each source's folder), otherwise it will use the
|
||||
`hosts` file that's already there.
|
||||
|
||||
### Usage
|
||||
|
||||
#### Using Python 3:
|
||||
|
||||
python3 updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Using Python 2.7:
|
||||
|
||||
python updateHostsFile.py [--auto] [--replace] [--ip nnn.nnn.nnn.nnn] [--extensions ext1 ext2 ext3]
|
||||
|
||||
#### Command line options:
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
`--auto`, or `-a`: run the script without prompting. When `--auto` is invoked,
|
||||
|
||||
* Hosts data sources, including extensions, are updated.
|
||||
* No extensions are included by default. Use the `--extensions` or `-e` flag to include any you want.
|
||||
* Your active hosts file is *not* replaced unless you include the `--replace` flag.
|
||||
|
||||
`--backup`, or `-b`: Make a backup of existing hosts file(s) as you generate over them.
|
||||
|
||||
`--extensions <ext1> <ext2> <ext3>`, or `-e <ext1> <ext2> <ext3>`: the names of subfolders below the `extensions` folder
|
||||
containing additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or
|
||||
`-e social porn`.
|
||||
|
||||
`--ip nnn.nnn.nnn.nnn`, or `-i nnn.nnn.nnn.nnn`: the IP address to use as the target. Default is `0.0.0.0`.
|
||||
|
||||
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
|
||||
|
||||
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file in a subfolder. If the subfolder does not
|
||||
exist, it will be created.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts
|
||||
|
||||
`--skipstatichosts`, or `-s`: `false` (default) or `true`, omit the standard section, at the top containing lines like `127.0.0.1 localhost`. This is useful for configuring proximate DNS services on the local network.
|
||||
|
||||
|
||||
## How do I control which sources are unified?
|
||||
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
`update.info` file.
|
||||
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
`update.info` controls where this extension finds its updates.
|
||||
|
||||
### How do I include my own custom domain mappings?
|
||||
|
||||
If you have custom hosts records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
unified hosts file during the update process.
|
||||
|
||||
The `myhosts` file is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo from `origin` in the future.
|
||||
|
||||
### How do I prevent domains from being included?
|
||||
|
||||
The domains you list in the `whitelist` file are excluded from the final hosts file.
|
||||
|
||||
The `whitelist` uses partial matching. Therefore if you whitelist `google-analytics.com`, that domain and all its
|
||||
subdomains won't be merged into the final hosts file.
|
||||
|
||||
The `whitelist` is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo
|
||||
from `origin` in the future.
|
||||
|
||||
|
||||
## What is a hosts file?
|
||||
|
||||
A hosts file, named `hosts` (with no file extension), is a plain-text file used by all operating
|
||||
systems to map hostnames to IP addresses.
|
||||
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a domain name is
|
||||
resolved by the `hosts` file, the request never leaves your computer.
|
||||
|
||||
Having a smart `hosts` file goes a long way towards blocking malware, adware, and other irritants.
|
||||
|
||||
For example, to nullify requests to some doubleclick.net servers, adding these lines to your hosts
|
||||
file will do it:
|
||||
|
||||
# block doubleClick's servers
|
||||
127.0.0.1 ad.ae.doubleclick.net
|
||||
127.0.0.1 ad.ar.doubleclick.net
|
||||
127.0.0.1 ad.at.doubleclick.net
|
||||
127.0.0.1 ad.au.doubleclick.net
|
||||
127.0.0.1 ad.be.doubleclick.net
|
||||
# etc...
|
||||
|
||||
|
||||
## We recommend using `0.0.0.0` instead of `127.0.0.1`
|
||||
Using `0.0.0.0` is faster because you don't have to wait for a timeout. It also does not interfere
|
||||
with a web server that may be running on the local PC.
|
||||
|
||||
## Why not use just `0` instead of `0.0.0.0`?
|
||||
We tried that. Using `0` doesn't work universally.
|
||||
|
||||
|
||||
## Location of your hosts file
|
||||
To modify your current `hosts` file, look for it in the following places and modify it with a text
|
||||
editor.
|
||||
|
||||
**Mac OS X, iOS, Android, Linux**: `/etc/hosts` folder.
|
||||
|
||||
**Windows**: `%SystemRoot%\system32\drivers\etc\hosts` folder.
|
||||
|
||||
## Reloading hosts file
|
||||
Your operating system will cache DNS lookups. You can either reboot or run the following commands to
|
||||
manually flush your DNS cache once the new hosts file is in place.
|
||||
|
||||
### Mac OS X
|
||||
Open a Terminal and run:
|
||||
|
||||
`sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder`
|
||||
|
||||
### Windows
|
||||
Open a Command Prompt:
|
||||
|
||||
**Windows XP**: Start -> Run -> `cmd`
|
||||
|
||||
**Windows Vista, 7**: Start Button -> type `cmd` -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
**Windows 8**: Start -> Swipe Up -> All Apps -> Windows System -> right-click Command Prompt ->
|
||||
"Run as Administrator"
|
||||
|
||||
and run:
|
||||
|
||||
`ipconfig /flushdns`
|
||||
|
||||
### Linux
|
||||
Open a Terminal and run with root privileges:
|
||||
|
||||
**Debian/Ubuntu** `sudo /etc/rc.d/init.d/nscd restart`
|
||||
|
||||
**Linux with systemd**: `sudo systemctl restart network.service`
|
||||
|
||||
**Fedora Linux**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Network Manager**: `sudo systemctl restart NetworkManager.service`
|
||||
|
||||
**Arch Linux/Manjaro with Wicd**: `sudo systemctl restart wicd.service`
|
||||
|
||||
**Others**: Consult [this wikipedia article](https://en.wikipedia.org/wiki/Hosts_%28file%29#Location_in_the_file_system).
|
||||
|
||||
|
||||
## Goals of this unified hosts file
|
||||
|
||||
The goals of this repo are to:
|
||||
|
||||
1. automatically combine high-quality lists of hosts,
|
||||
|
||||
2. provide easy extensions,
|
||||
|
||||
3. de-dupe the resultant combined list,
|
||||
|
||||
4. and keep the resultant file reasonably sized.
|
||||
|
||||
A high-quality source is defined here as one that is actively curated. A hosts source should be frequently
|
||||
updated by its maintainers with both additions and removals. The larger the hosts file, the higher the level of
|
||||
curation is expected.
|
||||
|
||||
For example, the (huge) hosts file from [hosts-file.net](http://hosts-file.net) is **not** included
|
||||
here because it is very large (300,000+ entries) and doesn't currently display a corresponding high level of curation
|
||||
activity.
|
||||
|
||||
It is expected that this unified hosts file will serve both desktop and mobile devices under a variety of operating
|
||||
systems.
|
||||
@@ -1,8 +1,10 @@
|
||||
#=====================================
|
||||
# Hosts contributed by Steven Black
|
||||
# http://stevenblack.com
|
||||
127.0.0.1 1493361689.rsc.cdn77.org
|
||||
127.0.0.1 30-day-change.com
|
||||
127.0.0.1 adsmws.cloudapp.net
|
||||
127.0.0.1 annualconsumersurvey.com
|
||||
127.0.0.1 apps.id.net
|
||||
127.0.0.1 canuck-method.com
|
||||
127.0.0.1 www.canuck-method.com
|
||||
@@ -13,9 +15,12 @@
|
||||
127.0.0.1 save-your-pc.info
|
||||
127.0.0.1 embed.sendtonews.com
|
||||
127.0.0.1 promotion.com-rewards.club
|
||||
127.0.0.1 s.zkcdn.net
|
||||
127.0.0.1 specialsections.siteseer.ca
|
||||
127.0.0.1 stealthedeal.com
|
||||
127.0.0.1 twitter.cm # common misspelling
|
||||
127.0.0.1 ttwitter.com # common misspelling and, besides, scumbags there.
|
||||
127.0.0.1 virtual.thewhig.com
|
||||
127.0.0.1 www.quickcash-system.com
|
||||
#=====================================
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
http://adaway.org/hosts.txt
|
||||
https://adaway.org/hosts.txt
|
||||
|
||||
+586
-338
File diff suppressed because it is too large
Load Diff
+167
-300
File diff suppressed because it is too large
Load Diff
+154
-431
File diff suppressed because it is too large
Load Diff
+9
-45
@@ -2,8 +2,8 @@
|
||||
#
|
||||
# For more information about this list, see: https://pgl.yoyo.org/adservers/
|
||||
# ----
|
||||
# last updated: Mon, 22 Feb 2016 09:11:57 GMT
|
||||
# entries: 2431
|
||||
# last updated: Mon, 16 May 2016 12:52:58 GMT
|
||||
# entries: 2395
|
||||
# format: hosts (hosts -- in hosts file format)
|
||||
# credits: Peter Lowe - pgl@yoyo.org - https://pgl.yoyo.org/ - https://twitter.com/pgl
|
||||
# this URL: https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext&useip=0.0.0.0
|
||||
@@ -72,7 +72,6 @@
|
||||
0.0.0.0 ad-tech.com
|
||||
0.0.0.0 ad-up.com
|
||||
0.0.0.0 ad.100.tbn.ru
|
||||
0.0.0.0 ad.103092804.com
|
||||
0.0.0.0 ad.71i.de
|
||||
0.0.0.0 ad.980x.com
|
||||
0.0.0.0 ad.a8.net
|
||||
@@ -269,7 +268,6 @@
|
||||
0.0.0.0 adlantic.nl
|
||||
0.0.0.0 adledge.com
|
||||
0.0.0.0 adlegend.com
|
||||
0.0.0.0 adlink.de
|
||||
0.0.0.0 adlog.com.com
|
||||
0.0.0.0 adloox.com
|
||||
0.0.0.0 adlooxtracking.com
|
||||
@@ -297,8 +295,6 @@
|
||||
0.0.0.0 admob.com
|
||||
0.0.0.0 admonitor.com
|
||||
0.0.0.0 admotion.com.ar
|
||||
0.0.0.0 admtpmp123.com
|
||||
0.0.0.0 admtpmp124.com
|
||||
0.0.0.0 adnet-media.net
|
||||
0.0.0.0 adnet.asahi.com
|
||||
0.0.0.0 adnet.biz
|
||||
@@ -403,6 +399,7 @@
|
||||
0.0.0.0 ads.co.com
|
||||
0.0.0.0 ads.com.com
|
||||
0.0.0.0 ads.contactmusic.com
|
||||
0.0.0.0 ads.contentabc.com
|
||||
0.0.0.0 ads.contextweb.com
|
||||
0.0.0.0 ads.crakmedia.com
|
||||
0.0.0.0 ads.creative-serving.com
|
||||
@@ -422,7 +419,6 @@
|
||||
0.0.0.0 ads.digitalmedianet.com
|
||||
0.0.0.0 ads.digitalpoint.com
|
||||
0.0.0.0 ads.directionsmag.com
|
||||
0.0.0.0 ads.discovery.com
|
||||
0.0.0.0 ads.domeus.com
|
||||
0.0.0.0 ads.eagletribune.com
|
||||
0.0.0.0 ads.easy-forex.com
|
||||
@@ -536,7 +532,6 @@
|
||||
0.0.0.0 ads.moceanads.com
|
||||
0.0.0.0 ads.motor-forum.nl
|
||||
0.0.0.0 ads.motormedia.nl
|
||||
0.0.0.0 ads.movieflix.com
|
||||
0.0.0.0 ads.msn.com
|
||||
0.0.0.0 ads.multimania.lycos.fr
|
||||
0.0.0.0 ads.nationalgeographic.com
|
||||
@@ -549,7 +544,6 @@
|
||||
0.0.0.0 ads.newmedia.cz
|
||||
0.0.0.0 ads.newsint.co.uk
|
||||
0.0.0.0 ads.newsquest.co.uk
|
||||
0.0.0.0 ads.newtention.net
|
||||
0.0.0.0 ads.ninemsn.com.au
|
||||
0.0.0.0 ads.nj.com
|
||||
0.0.0.0 ads.nola.com
|
||||
@@ -595,7 +589,6 @@
|
||||
0.0.0.0 ads.redtube.com
|
||||
0.0.0.0 ads.resoom.de
|
||||
0.0.0.0 ads.returnpath.net
|
||||
0.0.0.0 ads.rottentomatoes.com
|
||||
0.0.0.0 ads.rpgdot.com
|
||||
0.0.0.0 ads.s3.sitepoint.com
|
||||
0.0.0.0 ads.satyamonline.com
|
||||
@@ -612,7 +605,6 @@
|
||||
0.0.0.0 ads.smartclick.com
|
||||
0.0.0.0 ads.soft32.com
|
||||
0.0.0.0 ads.space.com
|
||||
0.0.0.0 ads.spoonfeduk.com
|
||||
0.0.0.0 ads.sptimes.com
|
||||
0.0.0.0 ads.stackoverflow.com
|
||||
0.0.0.0 ads.stationplay.com
|
||||
@@ -627,7 +619,6 @@
|
||||
0.0.0.0 ads.theglobeandmail.com
|
||||
0.0.0.0 ads.themovienation.com
|
||||
0.0.0.0 ads.thestar.com
|
||||
0.0.0.0 ads.thewebfreaks.com
|
||||
0.0.0.0 ads.timeout.com
|
||||
0.0.0.0 ads.tjwi.info
|
||||
0.0.0.0 ads.tmcs.net
|
||||
@@ -689,6 +680,7 @@
|
||||
0.0.0.0 ads180.com
|
||||
0.0.0.0 ads2.brazzers.com
|
||||
0.0.0.0 ads2.clearchannel.com
|
||||
0.0.0.0 ads2.contentabc.com
|
||||
0.0.0.0 ads2.gamecity.net
|
||||
0.0.0.0 ads2.jubii.dk
|
||||
0.0.0.0 ads2.net-communities.co.uk
|
||||
@@ -697,6 +689,7 @@
|
||||
0.0.0.0 ads2.virtual-nights.com
|
||||
0.0.0.0 ads2.xnet.cz
|
||||
0.0.0.0 ads2004.treiberupdate.de
|
||||
0.0.0.0 ads3.contentabc.com
|
||||
0.0.0.0 ads3.gamecity.net
|
||||
0.0.0.0 ads3.virtual-nights.com
|
||||
0.0.0.0 ads4.clearchannel.com
|
||||
@@ -740,7 +733,6 @@
|
||||
0.0.0.0 adserver.bizhat.com
|
||||
0.0.0.0 adserver.break-even.it
|
||||
0.0.0.0 adserver.cams.com
|
||||
0.0.0.0 adserver.clashmusic.com
|
||||
0.0.0.0 adserver.com
|
||||
0.0.0.0 adserver.digitoday.com
|
||||
0.0.0.0 adserver.dotcommedia.de
|
||||
@@ -756,7 +748,6 @@
|
||||
0.0.0.0 adserver.janes.com
|
||||
0.0.0.0 adserver.kyoceramita-europe.com
|
||||
0.0.0.0 adserver.libero.it
|
||||
0.0.0.0 adserver.motorpresse.de
|
||||
0.0.0.0 adserver.news.com.au
|
||||
0.0.0.0 adserver.ngz-network.de
|
||||
0.0.0.0 adserver.nydailynews.com
|
||||
@@ -887,7 +878,6 @@
|
||||
0.0.0.0 adworx.nl
|
||||
0.0.0.0 adx.allstar.cz
|
||||
0.0.0.0 adx.atnext.com
|
||||
0.0.0.0 adx.gainesvillesun.com
|
||||
0.0.0.0 adxpansion.com
|
||||
0.0.0.0 adxpose.com
|
||||
0.0.0.0 adxvalue.com
|
||||
@@ -917,7 +907,6 @@
|
||||
0.0.0.0 affiliates.globat.com
|
||||
0.0.0.0 affiliates.ige.com
|
||||
0.0.0.0 affiliates.internationaljock.com
|
||||
0.0.0.0 affiliates.jlist.com
|
||||
0.0.0.0 affiliates.streamray.com
|
||||
0.0.0.0 affiliates.thinkhost.net
|
||||
0.0.0.0 affiliates.thrixxx.com
|
||||
@@ -926,12 +915,12 @@
|
||||
0.0.0.0 affiliatetracking.net
|
||||
0.0.0.0 affiliatewindow.com
|
||||
0.0.0.0 affiliation-france.com
|
||||
0.0.0.0 afftracking.justanswer.com
|
||||
0.0.0.0 ah-ha.com
|
||||
0.0.0.0 ahalogy.com
|
||||
0.0.0.0 aidu-ads.de
|
||||
0.0.0.0 aim4media.com
|
||||
0.0.0.0 aistat.net
|
||||
0.0.0.0 ajouter.net
|
||||
0.0.0.0 aktrack.pubmatic.com
|
||||
0.0.0.0 alclick.com
|
||||
0.0.0.0 alenty.com
|
||||
@@ -961,7 +950,6 @@
|
||||
0.0.0.0 as1.advfn.com
|
||||
0.0.0.0 as2.advfn.com
|
||||
0.0.0.0 as5000.com
|
||||
0.0.0.0 assets.loomia.com
|
||||
0.0.0.0 assets1.exgfnetwork.com
|
||||
0.0.0.0 assoc-amazon.com
|
||||
0.0.0.0 at-adserver.alltop.com
|
||||
@@ -1246,7 +1234,6 @@
|
||||
0.0.0.0 contaxe.de
|
||||
0.0.0.0 content.acc-hd.de
|
||||
0.0.0.0 content.ad
|
||||
0.0.0.0 contentabc.com
|
||||
0.0.0.0 contextweb.com
|
||||
0.0.0.0 conversantmedia.com
|
||||
0.0.0.0 conversionruler.com
|
||||
@@ -1255,9 +1242,7 @@
|
||||
0.0.0.0 count.rbc.ru
|
||||
0.0.0.0 count.rin.ru
|
||||
0.0.0.0 count.west263.com
|
||||
0.0.0.0 count6.rbc.ru
|
||||
0.0.0.0 counted.com
|
||||
0.0.0.0 counter.avtoindex.com
|
||||
0.0.0.0 counter.bloke.com
|
||||
0.0.0.0 counter.cnw.cz
|
||||
0.0.0.0 counter.cz
|
||||
@@ -1313,7 +1298,6 @@
|
||||
0.0.0.0 decknetwork.net
|
||||
0.0.0.0 deloo.de
|
||||
0.0.0.0 demandbase.com
|
||||
0.0.0.0 depilflash.tv
|
||||
0.0.0.0 di1.shopping.com
|
||||
0.0.0.0 dialerporn.com
|
||||
0.0.0.0 didtheyreadit.com
|
||||
@@ -1388,8 +1372,6 @@
|
||||
0.0.0.0 eurekster.com
|
||||
0.0.0.0 euro-linkindex.de
|
||||
0.0.0.0 euroclick.com
|
||||
0.0.0.0 european-toplist.de
|
||||
0.0.0.0 euroranking.de
|
||||
0.0.0.0 euros4click.de
|
||||
0.0.0.0 eusta.de
|
||||
0.0.0.0 evergage.com
|
||||
@@ -1443,6 +1425,7 @@
|
||||
0.0.0.0 fpctraffic.com
|
||||
0.0.0.0 fpctraffic2.com
|
||||
0.0.0.0 fragmentserv.iac-online.de
|
||||
0.0.0.0 free-banners.com
|
||||
0.0.0.0 freebanner.com
|
||||
0.0.0.0 freelogs.com
|
||||
0.0.0.0 freeonlineusers.com
|
||||
@@ -1468,7 +1451,6 @@
|
||||
0.0.0.0 geo.digitalpoint.com
|
||||
0.0.0.0 geobanner.adultfriendfinder.com
|
||||
0.0.0.0 geovisite.com
|
||||
0.0.0.0 german-linkindex.de
|
||||
0.0.0.0 getclicky.com
|
||||
0.0.0.0 globalismedia.com
|
||||
0.0.0.0 globaltakeoff.net
|
||||
@@ -1492,7 +1474,6 @@
|
||||
0.0.0.0 greystripe.com
|
||||
0.0.0.0 gtop.ro
|
||||
0.0.0.0 gtop100.com
|
||||
0.0.0.0 gtsads.com
|
||||
0.0.0.0 harrenmedia.com
|
||||
0.0.0.0 harrenmedianetwork.com
|
||||
0.0.0.0 havamedia.net
|
||||
@@ -1539,7 +1520,6 @@
|
||||
0.0.0.0 hyperbanner.net
|
||||
0.0.0.0 hypertracker.com
|
||||
0.0.0.0 i-clicks.net
|
||||
0.0.0.0 i-lookup.com
|
||||
0.0.0.0 i.xx.openx.com
|
||||
0.0.0.0 i1img.com
|
||||
0.0.0.0 i1media.no
|
||||
@@ -1568,6 +1548,7 @@
|
||||
0.0.0.0 imarketservices.com
|
||||
0.0.0.0 img.prohardver.hu
|
||||
0.0.0.0 imgpromo.easyrencontre.com
|
||||
0.0.0.0 imitrk.com
|
||||
0.0.0.0 imonitor.nethost.cz
|
||||
0.0.0.0 imprese.cz
|
||||
0.0.0.0 impressionmedia.cz
|
||||
@@ -1604,12 +1585,8 @@
|
||||
0.0.0.0 itop.cz
|
||||
0.0.0.0 its-that-easy.com
|
||||
0.0.0.0 itsptp.com
|
||||
0.0.0.0 jbeet.cjt1.net
|
||||
0.0.0.0 jcount.com
|
||||
0.0.0.0 jedonkey.cjt1.net
|
||||
0.0.0.0 jinkads.de
|
||||
0.0.0.0 jkazaa.cjt1.net
|
||||
0.0.0.0 jnova.cjt1.net
|
||||
0.0.0.0 joetec.net
|
||||
0.0.0.0 jokedollars.com
|
||||
0.0.0.0 js.users.51.la
|
||||
@@ -1678,7 +1655,6 @@
|
||||
0.0.0.0 madisonavenue.com
|
||||
0.0.0.0 mads.cnet.com
|
||||
0.0.0.0 madvertise.de
|
||||
0.0.0.0 malware-scan.com
|
||||
0.0.0.0 marchex.com
|
||||
0.0.0.0 market-buster.com
|
||||
0.0.0.0 marketing.888.com
|
||||
@@ -1731,9 +1707,7 @@
|
||||
0.0.0.0 microstatic.pl
|
||||
0.0.0.0 microticker.com
|
||||
0.0.0.0 midnightclicking.com
|
||||
0.0.0.0 mintrace.com
|
||||
0.0.0.0 misstrends.com
|
||||
0.0.0.0 miva.com
|
||||
0.0.0.0 mixpanel.com
|
||||
0.0.0.0 mixtraffic.com
|
||||
0.0.0.0 mlm.de
|
||||
@@ -1837,7 +1811,6 @@
|
||||
0.0.0.0 openad.travelnow.com
|
||||
0.0.0.0 openads.friendfinder.com
|
||||
0.0.0.0 openads.org
|
||||
0.0.0.0 openclick.com
|
||||
0.0.0.0 openx.angelsgroup.org.uk
|
||||
0.0.0.0 openx.blindferret.com
|
||||
0.0.0.0 opienetwork.com
|
||||
@@ -1855,9 +1828,9 @@
|
||||
0.0.0.0 p.adpdx.com
|
||||
0.0.0.0 pagead.l.google.com
|
||||
0.0.0.0 pagefair.com
|
||||
0.0.0.0 pagerank-estate-spb.ru
|
||||
0.0.0.0 pagerank-ranking.com
|
||||
0.0.0.0 pagerank-ranking.de
|
||||
0.0.0.0 pagerank-server7.de
|
||||
0.0.0.0 pagerank-submitter.com
|
||||
0.0.0.0 pagerank-submitter.de
|
||||
0.0.0.0 pagerank-suchmaschine.de
|
||||
@@ -1999,7 +1972,6 @@
|
||||
0.0.0.0 realclix.com
|
||||
0.0.0.0 realmedia-a800.d4p.net
|
||||
0.0.0.0 realtechnetwork.com
|
||||
0.0.0.0 realteencash.com
|
||||
0.0.0.0 realtracker.com
|
||||
0.0.0.0 reduxmedia.com
|
||||
0.0.0.0 reduxmediagroup.com
|
||||
@@ -2019,7 +1991,6 @@
|
||||
0.0.0.0 remotead.cnet.com
|
||||
0.0.0.0 republika.onet.pl
|
||||
0.0.0.0 retargeter.com
|
||||
0.0.0.0 rev2pub.com
|
||||
0.0.0.0 revenue.net
|
||||
0.0.0.0 revenuedirect.com
|
||||
0.0.0.0 revsci.net
|
||||
@@ -2067,7 +2038,6 @@
|
||||
0.0.0.0 servedbyadbutler.com
|
||||
0.0.0.0 servedbyopenx.com
|
||||
0.0.0.0 servethis.com
|
||||
0.0.0.0 service1.adten.de
|
||||
0.0.0.0 services.hearstmags.com
|
||||
0.0.0.0 serving-sys.com
|
||||
0.0.0.0 sexaddpro.de
|
||||
@@ -2077,7 +2047,6 @@
|
||||
0.0.0.0 sexlist.com
|
||||
0.0.0.0 sextracker.com
|
||||
0.0.0.0 sexystat.com
|
||||
0.0.0.0 sezwho.com
|
||||
0.0.0.0 shareadspace.com
|
||||
0.0.0.0 shareasale.com
|
||||
0.0.0.0 sharepointads.com
|
||||
@@ -2122,7 +2091,6 @@
|
||||
0.0.0.0 spywarelabs.com
|
||||
0.0.0.0 spywarenuker.com
|
||||
0.0.0.0 spywords.com
|
||||
0.0.0.0 srbijacafe.org
|
||||
0.0.0.0 srwww1.com
|
||||
0.0.0.0 starffa.com
|
||||
0.0.0.0 start.freeze.com
|
||||
@@ -2192,7 +2160,6 @@
|
||||
0.0.0.0 techclicks.net
|
||||
0.0.0.0 teenrevenue.com
|
||||
0.0.0.0 teliad.de
|
||||
0.0.0.0 test.com
|
||||
0.0.0.0 text-link-ads.com
|
||||
0.0.0.0 textad.sexsearch.com
|
||||
0.0.0.0 textads.biz
|
||||
@@ -2221,7 +2188,6 @@
|
||||
0.0.0.0 top123.ro
|
||||
0.0.0.0 top20.com
|
||||
0.0.0.0 top20free.com
|
||||
0.0.0.0 top66.ro
|
||||
0.0.0.0 top90.ro
|
||||
0.0.0.0 topbarh.box.sk
|
||||
0.0.0.0 topblogarea.se
|
||||
@@ -2301,7 +2267,6 @@
|
||||
0.0.0.0 uarating.com
|
||||
0.0.0.0 ukbanners.com
|
||||
0.0.0.0 ultramercial.com
|
||||
0.0.0.0 ultsearch.com
|
||||
0.0.0.0 unanimis.co.uk
|
||||
0.0.0.0 untd.com
|
||||
0.0.0.0 updated.com
|
||||
@@ -2432,7 +2397,6 @@
|
||||
0.0.0.0 zanox-affiliate.de
|
||||
0.0.0.0 zanox.com
|
||||
0.0.0.0 zantracker.com
|
||||
0.0.0.0 zde-affinity.edgecaching.net
|
||||
0.0.0.0 zedo.com
|
||||
0.0.0.0 zencudo.co.uk
|
||||
0.0.0.0 zenkreka.com
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
0.0.0.0 super88.club
|
||||
0.0.0.0 tatts.com
|
||||
0.0.0.0 uberskins.net
|
||||
0.0.0.0 pokerstars.eu
|
||||
0.0.0.0 www.pokerstars.eu
|
||||
0.0.0.0 www.10bet.com
|
||||
0.0.0.0 www.12bet.com
|
||||
0.0.0.0 www.1337bid.com
|
||||
|
||||
+11
-1
@@ -1,5 +1,5 @@
|
||||
# Porn hosts
|
||||
# Updated March 6, 2016
|
||||
# Updated March 29, 2016
|
||||
|
||||
127.0.0.1 007angels.com
|
||||
127.0.0.1 www.007angels.com
|
||||
@@ -3625,6 +3625,8 @@
|
||||
127.0.0.1 nsgalleries.com
|
||||
127.0.0.1 www.nsgalleries.com
|
||||
127.0.0.1 cdn.nsimg.net
|
||||
127.0.0.1 nubiles.net
|
||||
127.0.0.1 www.nubiles.net
|
||||
127.0.0.1 nubiles-videos.com
|
||||
127.0.0.1 www.nubiles-videos.com
|
||||
127.0.0.1 nudebeachgalleries.net
|
||||
@@ -4006,8 +4008,12 @@
|
||||
127.0.0.1 www.porncash.tv
|
||||
127.0.0.1 pornclub.com
|
||||
127.0.0.1 www.pornclub.com
|
||||
127.0.0.1 porndig.com
|
||||
127.0.0.1 www.porndig.com
|
||||
127.0.0.1 porndisney.com
|
||||
127.0.0.1 www.porndisney.com
|
||||
127.0.0.1 porneq.com
|
||||
127.0.0.1 www.porneq.com
|
||||
127.0.0.1 ads.pornerbros.com
|
||||
127.0.0.1 porngalleriesz.com
|
||||
127.0.0.1 www.porngalleriesz.com
|
||||
@@ -4977,6 +4983,8 @@
|
||||
127.0.0.1 www.thumblogger.com
|
||||
127.0.0.1 thumbsweek.com
|
||||
127.0.0.1 www.thumbsweek.com
|
||||
127.0.0.1 thumbzilla.com
|
||||
127.0.0.1 www.thumbzilla.com
|
||||
127.0.0.1 tiavaswebcams.com
|
||||
127.0.0.1 www.tiavaswebcams.com
|
||||
127.0.0.1 affiliate-cash.tied-angels.com
|
||||
@@ -5124,6 +5132,8 @@
|
||||
127.0.0.1 ads1.tuccus.com
|
||||
127.0.0.1 ads2.tuccus.com
|
||||
127.0.0.1 www.tuccus.com
|
||||
127.0.0.1 tushyporn.net
|
||||
127.0.0.1 www.tushyporn.net
|
||||
127.0.0.1 tv69.com
|
||||
127.0.0.1 streaming.tv69.com
|
||||
127.0.0.1 www.tv69.com
|
||||
|
||||
@@ -12,7 +12,7 @@ Here are some sample calls, which vary which extensions are included.
|
||||
|
||||
**Using Python 3**:
|
||||
|
||||
python3 updateHostsFile.py -a --extensions porn social gambling
|
||||
python3 updateHostsFile.py --auto --extensions porn social gambling
|
||||
|
||||
or, in short form:
|
||||
|
||||
@@ -22,7 +22,7 @@ or, in short form:
|
||||
|
||||
**Using Python 2.7**:
|
||||
|
||||
python updateHostsFile.py -a --extensions porn social gambling
|
||||
python updateHostsFile.py -auto --extensions porn social gambling
|
||||
|
||||
or, in short form:
|
||||
|
||||
|
||||
+193
-6
@@ -1,40 +1,157 @@
|
||||
# facebook
|
||||
# Social media hosts
|
||||
# Updated April 16, 2016
|
||||
|
||||
# Facebook
|
||||
127.0.0.1 0-act.channel.facebook.com
|
||||
127.0.0.1 0-edge-chat.facebook.com
|
||||
127.0.0.1 1-act.channel.facebook.com
|
||||
127.0.0.1 1-edge-chat.facebook.com
|
||||
127.0.0.1 2-act.channel.facebook.com
|
||||
127.0.0.1 2-edge-chat.facebook.com
|
||||
127.0.0.1 3-act.channel.facebook.com
|
||||
127.0.0.1 3-edge-chat.facebook.com
|
||||
127.0.0.1 4-act.channel.facebook.com
|
||||
127.0.0.1 4-edge-chat.facebook.com
|
||||
127.0.0.1 5-act.channel.facebook.com
|
||||
127.0.0.1 5-edge-chat.facebook.com
|
||||
127.0.0.1 6-act.channel.facebook.com
|
||||
127.0.0.1 6-edge-chat.facebook.com
|
||||
127.0.0.1 act.channel.facebook.com
|
||||
127.0.0.1 api-read.facebook.com
|
||||
127.0.0.1 api.ak.facebook.com
|
||||
127.0.0.1 api.connect.facebook.com
|
||||
127.0.0.1 api.facebook.com
|
||||
127.0.0.1 app.facebook.com
|
||||
127.0.0.1 apps.facebook.com
|
||||
127.0.0.1 ar-ar.facebook.com
|
||||
127.0.0.1 attachment.fbsbx.com
|
||||
127.0.0.1 attachments.facebook.com
|
||||
127.0.0.1 b-api.facebook.com
|
||||
127.0.0.1 b-graph.facebook.com
|
||||
127.0.0.1 b.static.ak.facebook.com
|
||||
127.0.0.1 b.static.ak.fbcdn.net
|
||||
127.0.0.1 badge.facebook.com
|
||||
127.0.0.1 beta-chat-01-05-ash3.facebook.com
|
||||
127.0.0.1 bigzipfiles.facebook.com
|
||||
127.0.0.1 blog.facebook.com
|
||||
127.0.0.1 channel-ecmp-05-ash3.facebook.com
|
||||
127.0.0.1 channel-staging-ecmp-05-ash3.facebook.com
|
||||
127.0.0.1 channel-testing-ecmp-05-ash3.facebook.com
|
||||
127.0.0.1 check4.facebook.com
|
||||
127.0.0.1 check6.facebook.com
|
||||
127.0.0.1 code.facebook.com
|
||||
127.0.0.1 connect.facebook.com
|
||||
127.0.0.1 connect.facebook.net
|
||||
127.0.0.1 creative.ak.fbcdn.net
|
||||
127.0.0.1 d.facebook.com
|
||||
127.0.0.1 de-de.facebook.com
|
||||
127.0.0.1 developers.facebook.com
|
||||
127.0.0.1 edge-chat.facebook.com
|
||||
127.0.0.1 ent-a.xx.fbcdn.net
|
||||
127.0.0.1 ent-b.xx.fbcdn.net
|
||||
127.0.0.1 ent-c.xx.fbcdn.net
|
||||
127.0.0.1 ent-d.xx.fbcdn.net
|
||||
127.0.0.1 ent-e.xx.fbcdn.net
|
||||
127.0.0.1 es-la.facebook.com
|
||||
127.0.0.1 external.ak.fbcdn.net
|
||||
127.0.0.1 facebook.com
|
||||
127.0.0.1 facebook.de
|
||||
127.0.0.1 facebook.fr
|
||||
127.0.0.1 fb.me
|
||||
127.0.0.1 fbcdn-creative-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-photos-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-photos-e-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-profile-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-sphotos-a-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-sphotos-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-sphotos-b-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-sphotos-c-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-sphotos-d-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-sphotos-e-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-sphotos-f-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-sphotos-g-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-sphotos-h-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-a-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-b-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-c-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-d-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-e-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-f-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-g-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-h-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-i-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-j-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-k-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-l-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-m-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-n-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-o-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-video-p-a.akamaihd.net
|
||||
127.0.0.1 fbcdn-vthumb-a.akamaihd.net
|
||||
127.0.0.1 fbcdn.com
|
||||
127.0.0.1 fbcdn.net
|
||||
127.0.0.1 fbexternal-a.akamaihd.net
|
||||
127.0.0.1 fbstatic-a.akamaihd.net
|
||||
127.0.0.1 fr-fr.facebook.com
|
||||
127.0.0.1 graph.facebook.com
|
||||
127.0.0.1 hi-in.facebook.com
|
||||
127.0.0.1 inyour-slb-01-05-ash3.facebook.com
|
||||
127.0.0.1 it-it.facebook.com
|
||||
127.0.0.1 ja-jp.facebook.com
|
||||
127.0.0.1 login.facebook.com
|
||||
127.0.0.1 m.facebook.com
|
||||
127.0.0.1 messages-facebook.com
|
||||
127.0.0.1 mqtt.facebook.com
|
||||
127.0.0.1 newsroom.fb.com
|
||||
127.0.0.1 orcart.facebook.com
|
||||
127.0.0.1 origincache-ai-01-05-ash3.fbcdn.net
|
||||
127.0.0.1 origincache-starfacebook-ai-01-05-ash3.facebook.com
|
||||
127.0.0.1 photos-a.ak.fbcdn.net
|
||||
127.0.0.1 photos-b.ak.fbcdn.net
|
||||
127.0.0.1 photos-c.ak.fbcdn.net
|
||||
127.0.0.1 photos-d.ak.fbcdn.net
|
||||
127.0.0.1 photos-e.ak.fbcdn.net
|
||||
127.0.0.1 photos-f.ak.fbcdn.net
|
||||
127.0.0.1 photos-g.ak.fbcdn.net
|
||||
127.0.0.1 photos-h.ak.fbcdn.net
|
||||
127.0.0.1 pixel.facebook.com
|
||||
127.0.0.1 profile.ak.facebook.com
|
||||
127.0.0.1 profile.ak.fbcdn.net
|
||||
127.0.0.1 pt-br.facebook.com
|
||||
127.0.0.1 s-external.ak.fbcdn.net
|
||||
127.0.0.1 s-static.ak.facebook.com
|
||||
127.0.0.1 s-static.ak.fbcdn.net
|
||||
127.0.0.1 s-static.facebook.com
|
||||
127.0.0.1 scontent-a-lax.xx.fbcdn.net
|
||||
127.0.0.1 scontent-a-sin.xx.fbcdn.net
|
||||
127.0.0.1 scontent-a.xx.fbcdn.net
|
||||
127.0.0.1 scontent-b-lax.xx.fbcdn.net
|
||||
127.0.0.1 scontent-b-sin.xx.fbcdn.net
|
||||
127.0.0.1 scontent-b.xx.fbcdn.net
|
||||
127.0.0.1 scontent-c.xx.fbcdn.net
|
||||
127.0.0.1 scontent-d.xx.fbcdn.net
|
||||
127.0.0.1 scontent-e.xx.fbcdn.net
|
||||
127.0.0.1 scontent-mxp.xx.fbcdn.net
|
||||
127.0.0.1 scontent.xx.fbcdn.net
|
||||
127.0.0.1 secure-profile.facebook.com
|
||||
127.0.0.1 secure.facebook.com
|
||||
127.0.0.1 sphotos-a.xx.fbcdn.net
|
||||
127.0.0.1 ssl.connect.facebook.com
|
||||
127.0.0.1 staticxx.facebook.com
|
||||
127.0.0.1 ssl.facebook.com
|
||||
127.0.0.1 star.c10r.facebook.com
|
||||
127.0.0.1 star.facebook.com
|
||||
127.0.0.1 static.ak.connect.facebook.com
|
||||
127.0.0.1 static.ak.facebook.com
|
||||
127.0.0.1 static.ak.fbcdn.net
|
||||
127.0.0.1 static.thefacebook.com
|
||||
127.0.0.1 staticxx.facebook.com
|
||||
127.0.0.1 touch.facebook.com
|
||||
127.0.0.1 upload.facebook.com
|
||||
127.0.0.1 video.xx.fbcdn.net
|
||||
127.0.0.1 vpn.tfbnw.net
|
||||
127.0.0.1 vthumb.ak.fbcdn.net
|
||||
127.0.0.1 vupload.facebook.com
|
||||
127.0.0.1 vupload2.vvv.facebook.com
|
||||
127.0.0.1 www.connect.facebook.net
|
||||
127.0.0.1 www.facebook.com
|
||||
127.0.0.1 www.facebook.de
|
||||
@@ -43,20 +160,90 @@
|
||||
127.0.0.1 www.fbcdn.net
|
||||
127.0.0.1 www.login.facebook.com
|
||||
127.0.0.1 zh-cn.facebook.com
|
||||
127.0.0.1 zh-tw.facebook.com
|
||||
|
||||
# twitter
|
||||
# Twitter
|
||||
127.0.0.1 www.twitter.com
|
||||
127.0.0.1 twitter.com
|
||||
127.0.0.1 pbs.twimg.com
|
||||
127.0.0.1 abs.twimg.com
|
||||
127.0.0.1 syndication.twitter.com
|
||||
|
||||
# instagram
|
||||
127.0.0.1 www.instagram.com
|
||||
# Instagram
|
||||
127.0.0.1 igcdn-photos-aa.akamaihd.net
|
||||
127.0.0.1 igcdn-photos-ba.akamaihd.net
|
||||
127.0.0.1 igcdn-photos-ca.akamaihd.net
|
||||
127.0.0.1 igcdn-photos-da.akamaihd.net
|
||||
127.0.0.1 igcdn-photos-ea.akamaihd.net
|
||||
127.0.0.1 igcdn-photos-fa.akamaihd.net
|
||||
127.0.0.1 igcdn-photos-ga.akamaihd.net
|
||||
127.0.0.1 igcdn-photos-ha.akamaihd.net
|
||||
127.0.0.1 instagram.com
|
||||
127.0.0.1 scontent-iad3-1.cdninstagram.com
|
||||
127.0.0.1 scontent.cdninstagram.com
|
||||
127.0.0.1 www.instagram.com
|
||||
|
||||
# linkedin
|
||||
# LinkedIn
|
||||
127.0.0.1 static.licdn.com
|
||||
127.0.0.1 www.linkedin.com
|
||||
127.0.0.1 media.licdn.com
|
||||
127.0.0.1 platform.linkedin.com
|
||||
|
||||
# MySpace
|
||||
127.0.0.1 browseusers.myspace.com
|
||||
127.0.0.1 classifieds.myspace.com
|
||||
127.0.0.1 collect.myspace.com
|
||||
127.0.0.1 events.myspace.com
|
||||
127.0.0.1 favorites.myspace.com
|
||||
127.0.0.1 forum.myspace.com
|
||||
127.0.0.1 groups.myspace.com
|
||||
127.0.0.1 home.myspace.com
|
||||
127.0.0.1 invite.myspace.com
|
||||
127.0.0.1 linux.myspace.com
|
||||
127.0.0.1 log.myspace.com
|
||||
127.0.0.1 login.myspace.com
|
||||
127.0.0.1 mail.myspace.com
|
||||
127.0.0.1 message.myspace.com
|
||||
127.0.0.1 messages.myspace.com
|
||||
127.0.0.1 music.myspace.com
|
||||
127.0.0.1 mx2.myspace.com
|
||||
127.0.0.1 myspace.com
|
||||
127.0.0.1 ns1.myspace.com
|
||||
127.0.0.1 ns2.myspace.com
|
||||
127.0.0.1 profile.myspace.com
|
||||
127.0.0.1 rio.myspace.com
|
||||
127.0.0.1 search.myspace.com
|
||||
127.0.0.1 security.myspace.com
|
||||
127.0.0.1 signup.myspace.com
|
||||
127.0.0.1 videos.myspace.com
|
||||
127.0.0.1 vids.myspace.com
|
||||
127.0.0.1 viewmorepics.myspace.com
|
||||
127.0.0.1 vmta01.myspace.com
|
||||
127.0.0.1 vmta02.myspace.com
|
||||
127.0.0.1 vmta03.myspace.com
|
||||
127.0.0.1 vmta04.myspace.com
|
||||
127.0.0.1 vmta05.myspace.com
|
||||
127.0.0.1 vmta06.myspace.com
|
||||
127.0.0.1 vmta07.myspace.com
|
||||
127.0.0.1 vmta08.myspace.com
|
||||
127.0.0.1 vmta09.myspace.com
|
||||
127.0.0.1 vmta10.myspace.com
|
||||
127.0.0.1 vmta11.myspace.com
|
||||
127.0.0.1 vmta12.myspace.com
|
||||
127.0.0.1 vmta13.myspace.com
|
||||
127.0.0.1 www.myspace.com
|
||||
127.0.0.1 www1.myspace.com
|
||||
|
||||
# pinterest
|
||||
127.0.0.1 pinterest.com
|
||||
127.0.0.1 www.pinterest.com
|
||||
127.0.0.1 s-passets-cache-ak0.pinimg.com
|
||||
|
||||
# tumblr
|
||||
127.0.0.1 tumblr.com
|
||||
127.0.0.1 www.tumblr.com
|
||||
127.0.0.1 cookiex.ngd.yahoo.com
|
||||
127.0.0.1 px.srvcs.tumblr.com
|
||||
127.0.0.1 secure.assets.tumblr.com
|
||||
127.0.0.1 36.media.tumblr.com
|
||||
127.0.0.1 38.media.tumblr.com
|
||||
|
||||
+474
@@ -0,0 +1,474 @@
|
||||
|
||||
0.1.0 / 2016-03-25
|
||||
==================
|
||||
|
||||
* Fresh hosts files generated.
|
||||
* Issue #77: fix bug with emitting comments.
|
||||
* Freshen everything.
|
||||
* Issue #77: regenerate hosts following this fix.
|
||||
* Issue #77: fix — account for empty lines.
|
||||
* Issue #77: fix - trim trailing whitespace from input lines.
|
||||
* Issue #117 — fix: restart network.service if applicable.
|
||||
* Redme tweaks, format the numbers in the table.
|
||||
* Readme tweaks.
|
||||
* Latest hosts files and readme files.
|
||||
* Fresh data from someonewhocares.org and malwaredomainlist.com.
|
||||
* Better header section in the unified hosts file.
|
||||
* Merge pull request #120 from FadeMind/master
|
||||
* fix typo in IP address @ 392 line
|
||||
* Updated hosts files and readme files.
|
||||
* Updated data from someonewhocares.org.
|
||||
* Updated makehosts.
|
||||
* Rows to alternates are now generative.
|
||||
* Global ectomy.
|
||||
* Tweaks to updateReadme.py
|
||||
* Moved the Python3 test earlier.
|
||||
* Function updateReadme is now orphaned.
|
||||
* Nor update the readmeData.json file for each build.
|
||||
* First pass at updatereadme.py.
|
||||
* Latest .gitignore file.
|
||||
* Basic readmeData.json file.
|
||||
* Latest, freshest hosts files and readme.
|
||||
* update from someonewhocares.org.
|
||||
* Update to lists of gambling sites.
|
||||
* Merge pull request #105 from itachi46/improve-dns-flush
|
||||
* Adding s.zkcdn.net, fixes #113.
|
||||
* Updated readme files, and a fresh hosts file, 27,267 unique entries.
|
||||
* Merge pull request #110 from matkoniecz/hostname
|
||||
* Merge pull request #112 from matkoniecz/refuse_update
|
||||
* Merge pull request #114 from xXKingRalphXx/master
|
||||
* Merge pull request #111 from matkoniecz/readme
|
||||
* Shortened python version check in updateHostsFile.py
|
||||
* Changed variable
|
||||
* include 127.0.1.1 <hostname> line partial, maybe full fix for #109
|
||||
* make -n working not only in combination with -a
|
||||
* replace 'prepend' by more true 'added near top'
|
||||
* Merge pull request #106 from matkoniecz/typo
|
||||
* remove typo in command example
|
||||
* Added dnsmasq and better messaging
|
||||
* Fredh hosts file. The unextended vanilla hosts file has 27,266 unique entries.
|
||||
* Data update from MalwareDomainList.com.
|
||||
* Table formatting.
|
||||
* Updated readme and hosts files for all extensions.
|
||||
* It's hosts, plural.
|
||||
* Note the number of unique domains in each hosts file's header.
|
||||
* Changed the readme to include a table of the available variants, with links.
|
||||
* New main hosts file with 27,262 unique entries.
|
||||
* New alternate hosts files generated.
|
||||
* Data updates from four sources.
|
||||
* Update the various hosts files.
|
||||
* Making it work in Python3.
|
||||
* Latest hosts files.
|
||||
* Data source update
|
||||
* Update to makehosts script.
|
||||
* Fixes #102.
|
||||
* Improved the readme.nmd files in subfolders.
|
||||
* Checking in various fresh hosts files and readme.md.
|
||||
* Shell script to generate various combinations of hosts files and extensions.
|
||||
* Create different readme.md for different extension combinations.
|
||||
* Latest unified hosts file with 27,254 unique entries.
|
||||
* Better destinction between long and short form option specification.
|
||||
* New option to pre-empt data source updates.
|
||||
* Create the output folder if it doesn't pre-exist.
|
||||
* Adding optional output path argument.
|
||||
* Fresh hosts file with 27,254 unique entries.
|
||||
* New domains found.
|
||||
* Latest hosts file, with 27,251 unique entries.
|
||||
* Update from yoyo.org.
|
||||
* Latest unified hosts file with 27,255 unique entries.
|
||||
* Update from malwaredomainlist.com.
|
||||
* Merge pull request #100 from tyzbit/master
|
||||
* Update update.info
|
||||
* added tyzbit hosts
|
||||
* Doh! Typo in the folder name,
|
||||
* Update the readme in the Extensions folder.
|
||||
* Update the readme to include the `gambling` extension.
|
||||
* New hosts file with 27,214 unique entries.
|
||||
* Data source updates.
|
||||
* New extension: gambling. It's a start.
|
||||
* Updated hosts file with 27,206 unique entries.
|
||||
* Updated hosts file with 27,206 entries.
|
||||
* Update the readme in the extensions folder.
|
||||
* Update the readme for the new `social` extension for social media hosts.
|
||||
* Social media hosts file retrieved and added to the repo.
|
||||
* Merge branch 'extension.social'
|
||||
* Added a source of social media hosts.
|
||||
* Latest hosts file generated; no changes since last time.
|
||||
* First commit, 'social' starter set.
|
||||
* Data source update.
|
||||
* Issue #92: fix - update.info is now treated as a list.
|
||||
* Formatting of license.txt.
|
||||
* Fresh unified hosts file with 27,206 unique entries.
|
||||
* Data update from malwaredomainlist and yoyo.
|
||||
* Fresh hosts file with 27,207 unique entries.
|
||||
* Fresh unified hosts file with 27,161 unique entries.
|
||||
* Updated data files.
|
||||
* updated data and hosts file.
|
||||
* Latest hosts file with 27,156 unique entries.
|
||||
* Update hosts data.
|
||||
* Latest unified hosts file with 27,150 unique entries.
|
||||
* Data updates.
|
||||
* Issues #59 and #97: yoyo appears to support https now.
|
||||
* Amalgamated -> Unified.
|
||||
* Change 'amalgamated' to 'unified'.
|
||||
* Improve amalgaated hosts file heading.
|
||||
* Ibid.
|
||||
* Readme tweaking.
|
||||
* Incremental tweaks to Readme.
|
||||
* Latest amalgamated hosts file with 27,149 unique entries.
|
||||
* Updated data sources.
|
||||
* Latest amalgamated hosts file with 27,152 unique entries.
|
||||
* Latest hosts file, with 27,151 unique entries.
|
||||
* Updates from malwaredomainlist and someobewhocares.
|
||||
* More readme refinements.
|
||||
* Only process source folders, and not files that may be present.
|
||||
* Typo.
|
||||
* Typo.
|
||||
* Updated amalgamated hosts file containing 27,150 unique entries.
|
||||
* Update from Someonewhocares.org.
|
||||
* Refine the readme.
|
||||
* More succinct formatting of the generation time.
|
||||
* Issue #57: fix - ignore blank lines in the whitelist.
|
||||
* Document the --replace command line flag.
|
||||
* Updated porn data source.
|
||||
* New command-line option, --replace, to activate host file replacement when in --auto mode.
|
||||
* Draw attention to the new extensions capability.
|
||||
* This readme hack just might work.
|
||||
* Additional docs for extensions under --auto.
|
||||
* Place extension documentation within the extensions folder.
|
||||
* Fresh hosts file with 27,148 unique entries.
|
||||
* New source data from github.com/Sinfonietta for optional porn extension.
|
||||
* Updated data from someonewhocares.org.
|
||||
* Update the readme for extensions.
|
||||
* Merge branch 'extensions'
|
||||
* Changes to support extensions.
|
||||
* Extension: a good source of porn links
|
||||
* Latest amalgamated hosts file with 27,147 unique entries.
|
||||
* Updated data sources.
|
||||
* Data source update.
|
||||
* First code alterations for extensions.
|
||||
* FIrst extension: hosts file for porn sites
|
||||
* Latest update has no host changes.
|
||||
* Issue #91: fix - make the date and time windows filesystem-compatible.
|
||||
* Latest amalgamated hosts file with 27,143 unique entries.
|
||||
* Issue #91: fix - hoping this works better under windows.
|
||||
* Fresh data from someonewhocares.org.
|
||||
* Updated readme.
|
||||
* Reference wikipedia for a fuller list of hosts file locations.
|
||||
* Latest hosts file with 27,142 unique entries.
|
||||
* Add 'fe80::1%lo0 localhost' which is in the OS X default hosts file.
|
||||
* Latest amalgamated hosts file, with 27,142 unique entries.
|
||||
* Update from malwaredomainlist.com.
|
||||
* Latest amalgamated hosts file with 27,140 unique entries.
|
||||
* Fix rendering of the 'local' domain found in someonewhocares.org. Resolves #89.
|
||||
* More concise file summary details.
|
||||
* The latest amalgamated hosts file with 27,141 unique entries.
|
||||
* Add localhost.localdomain and broadcasthost to the base hosts. This fixes Issue #87.
|
||||
* Updated hosts from yoyo.org.
|
||||
* Latest amalgamated hosts file with 27,145 unique entries.
|
||||
* Updated data from someonewhocares.org and malwaredomainlist.com.
|
||||
* Use 'GMT' instead of +0000 notation.
|
||||
* Better way to express the updated date.
|
||||
* Latest amalgamated hosts file with 27,139 unique entries.
|
||||
* Updated date from malwaredomainlist.org
|
||||
* Update the readme to include a freshness date.
|
||||
* Better elaborate the repo in the opening paragraph of the readme.
|
||||
* Clarify different calls for Python 2.7 and Python 3.
|
||||
* Update the readme. Closes #75.
|
||||
* Issue #75: document the new --ip (long) and -i (short) option flags.
|
||||
* Issue #75: pass-in the target IP address as an option.
|
||||
* TARGET_HOST is now targetIP.
|
||||
* Removed needless line feed in header.
|
||||
* Merge pull request #82 from FadeMind/patch-1
|
||||
* Automatically restart wicd service rule
|
||||
* Issue #64: fix - ignore the backup copies of prior hosts files.
|
||||
* Issue #77: fix - replace tabs with space.
|
||||
* Issue #77: fix - Remove spurrious spaces.
|
||||
* Small cleanup in the readme.
|
||||
* Latest amalgamated hosts file, with 27,140 unique entries.
|
||||
* Updated data sources.
|
||||
* Readme improvements. Document the --auto option.
|
||||
* Add a link to the latest raw version of the hosts file.
|
||||
* Merge pull request #80 from gigaslayer131890/master
|
||||
* Modified the removeOldHostsFile() function to keep backups of the old hosts file.
|
||||
* Merge pull request #78 from joshuarosato/patch-1
|
||||
* Update readme_template.md
|
||||
* Suppress marginal messages in --auto mode.
|
||||
* Less verbose when echoing source updates.
|
||||
* Fresh new amalgamated hosts file, this one with 27,139 unique entries.
|
||||
* Updates from three data sources.
|
||||
* Merge pull request #73 from likyng/patch-2
|
||||
* add service restart command for Arch Linux
|
||||
* Happy New Year
|
||||
* Import argparse, and add an --auto flag to run the update and merge with no prompts.
|
||||
* Updated data and generated hosts file.
|
||||
* Updated data, now with 27,146 unique entries.
|
||||
* Latest hosts file with 27,145 unique entries.
|
||||
* Updated data from mvps.org.
|
||||
* Fixes #65.
|
||||
* Remove initialized but thereafter unused variables.
|
||||
* Added local pylint directives.
|
||||
* Going with pylint's recommendation for singleton comparisons.
|
||||
* Standardize on double quotes in print() calls everywhere.
|
||||
* Split long code lines.
|
||||
* Removed more superfluous parens.
|
||||
* Removed unnecessary semicolons.
|
||||
* Split long code line.
|
||||
* Removed superfluous parens.
|
||||
* Split long code line.
|
||||
* Removed spaces after '(' and before ')'.
|
||||
* Indent with spaces.
|
||||
* Latest hosts file with 27,169 unique entries.
|
||||
* Updated data sources.
|
||||
* Revert "Variable 'target' is never used."
|
||||
* Variable 'target' is never used.
|
||||
* Line breaks in the readme.
|
||||
* Line breaks in the readme.
|
||||
* Updated amalgamated hosts file with 27,158 unique entries.
|
||||
* Updated readme to clarify the goals of the repo.
|
||||
* Updated two hosts sources.
|
||||
* New amalgamated hosts file, now with 27,158 unique entries.
|
||||
* Updated host file data from three sources.
|
||||
* Merge pull request #63 from FadeMind/master
|
||||
* automatic systemd NetworkManager service restart
|
||||
* New amalgamated hosts file, now with 27,147 unique entries.
|
||||
* Latest data refreshed.
|
||||
* Adding a reference to hosts-file.net to the readme even though it's not included here anymore.
|
||||
* Updated hosts file, now with 27,138 unique entries.
|
||||
* Updated sata sources.
|
||||
* Removed hosts-file.net as a source.
|
||||
* Merge pull request #59 from FadeMind/patch-1
|
||||
* Revert HTTPS for MDL due connection issue
|
||||
* Update readme.md for the recent addition of the hosts-file.net data source (part deux).
|
||||
* Update readme.md for the recent addition of the hosts-file.net data source.
|
||||
* New amalgamated hosts file, now with 356,328 unique entries.
|
||||
* Updated data from mvps.org, someonewhocares.org, and hosts-file.net.
|
||||
* Merge pull request #55 from Jonadabe/Jonadabe-patch-4
|
||||
* Create update.info
|
||||
* Update hosts
|
||||
* Create hosts
|
||||
* Latest amalgamated hosts file, with 27,157 unique entries.
|
||||
* Better handling of download errors.
|
||||
* Updated three data sources.
|
||||
* Updating my hosts list.
|
||||
* Merge pull request #54 from FadeMind/master
|
||||
* Using HTTPS for MDL hosts file source
|
||||
* Updated the amalgamated hosts file, now with 27,199 entries.
|
||||
* Update from MalwareDomainlist.com
|
||||
* Updated personal hosts list.
|
||||
* New amalgamated hosts file with 27,195 entries.
|
||||
* Updated host sources.
|
||||
* New amalgamated hosts file, containing 26,831 unique entries.
|
||||
* Updated data source.
|
||||
* Updated data sources.
|
||||
* Updated the amalgamated hosts file with 26,799 unique entries.
|
||||
* Updates from four data sources.
|
||||
* Updated my hosts list.
|
||||
* Merge pull request #48 from FadeMind/master
|
||||
* update Reloading hosts file instructions for Linux
|
||||
* Updated hosts file with 26,933 entries.
|
||||
* Updated data from malwaredomainlist.com.
|
||||
* Add at the top.
|
||||
* Merge pull request #46 from FrancoGag/master
|
||||
* Don't print '::1 localhost'
|
||||
* Fix IndentationError.
|
||||
* Refactor: whitespace for consistency and readability.
|
||||
* Fresh amalgamated hosts file with 26,932 unique entries.
|
||||
* Updated data sources.
|
||||
* Merge pull request #45 from hd074/master
|
||||
* Merge pull request #43 from FrancoGag/master
|
||||
* better delete after updating so we dont end up with an empty hosts file if update goes wrong and causes a crash
|
||||
* hotfix for duplicates and artefacts
|
||||
* Removed sys.exit()
|
||||
* Merge pull request #44 from mariusv/patch-2
|
||||
* OSX DNS flush to cover El Capitan
|
||||
* Check if 'hosts' file exists
|
||||
* Latest readme: 26,899 entries.
|
||||
* Why list the local data file name. I don't get it.
|
||||
* Revert "Why list the local source file name? I don't get it."
|
||||
* Why list the local source file name? I don't get it.
|
||||
* Not happy with the way this lists not the source URLS, but the local file names.
|
||||
* Updated data files.
|
||||
* Better handle the no-domain-in-the-line error in data. This closes #38.
|
||||
* Merge pull request #36 from FrancoGag/master
|
||||
* Renamed removeDups() to removeDupsAndExcl()
|
||||
* Fixed: Exclude domains in the whitelist (2)
|
||||
* Fixed: Exclude domains in the whitelist
|
||||
* Create whitelist
|
||||
* Exclude domains contained in a whitelist
|
||||
* Ignore whitelist file
|
||||
* Update updateHostsFile.py
|
||||
* Delete .DS_Store from Data
|
||||
* Updated hosts file, still with 26,888 entries.
|
||||
* Updated data and new amalgamated hosts file with 26,888 entries.
|
||||
* Added a line to myhosts, for better clarity in the generated file.
|
||||
* Documentation for the myhosts file.
|
||||
* Merge pull request #34 from qutorial/myhosts
|
||||
* Merge pull request #35 from qutorial/ubuntufix
|
||||
* Fixed ubuntu hosts file relaod
|
||||
* Update to include preamble handling
|
||||
* One new host, so updated hosts file.
|
||||
* New host
|
||||
* Updated hosts file with 26,891 unique entries.
|
||||
* File is unavailable. Don't raise this error; just eat it.
|
||||
* Trim whitespace in updateHostsFile.py
|
||||
* Updated data files.
|
||||
* Merge pull request #33 from qutorial/migrationToPython3
|
||||
* Cross-python implementation
|
||||
* Migrated to Python 3
|
||||
* Merge pull request #30 from qqo/master
|
||||
* 'suffix' in regex matches empty string on all the data files, except one (incorrect) line containing port: 0.0.0.0 telemetry.appex.bing.net:443 The resulting entry in hosts file generated like this: 0.0.0.0 telemetry.appex.bing.net :443 which is incorrect. The bug was not spotted only because the incorrect line in the data source was after the correct line without port, thus it was ignored and not added to resulting hosts file.
|
||||
* Explicitly lowercase hostname to prevent mixed-case duplicates.
|
||||
* New amalgamated hosts file, now with 26,938 unique entries.
|
||||
* Updated data from three hosts providers.
|
||||
* Fresh amalgamated hosts file with 26,826 entries.
|
||||
* Updated data from someonewhocares.org.
|
||||
* Merge pull request #29 from qutorial/master
|
||||
* os.path.join introduced
|
||||
* Latest amalgamated hosts file.
|
||||
* This domain dishes autoplay video which I hate.
|
||||
* New amalgamated hosts file with 26,827 unique entries.
|
||||
* Refinements to the readme template.
|
||||
* Updated data from yoyo.org.
|
||||
* New amalgamated hosts file with 26,827 unique entries.
|
||||
* Refreshed data sources.
|
||||
* Better explanation of why 0.0.0.0 is faster than 127.0.0.1.
|
||||
* Prettier formatting of the number of host records.
|
||||
* Latest amalgamated hosts file, now 26,823 entries.
|
||||
* Update my ad-hoc hosts list.
|
||||
* Fresh amalgamated hosts file: 26,822 entries.
|
||||
* Updated other data sources.
|
||||
* Added apps.id.net. Also sorted my hosts.
|
||||
* Latest amalgamated hosts file.
|
||||
* Two more data updates.
|
||||
* Added save-your-pc.info
|
||||
* New hosts file, 26,792 uniques.
|
||||
* Update from host data sources.
|
||||
* Host file now lists 127.0.0.1 localhost, 0.0.0.0 the others.
|
||||
* The latest amalgamated hosts file with 26792 unique entries.
|
||||
* Updated readme.
|
||||
* Updated source files.
|
||||
* Reverting the target host back to 0.0.0.0.
|
||||
* Updated hosts from data, and generated a new amalgamated hosts file.
|
||||
* Fix the update script so we don't write any dupes.
|
||||
* Replace the target host from `0.0.0.0` with `0`.
|
||||
* Use the proper URL for my list of hosts.
|
||||
* New popup seen today.
|
||||
* Added the readme changes suggested by @mpsOxygen to the template file.
|
||||
* Merge pull request #23 from mpsOxygen/patch-1
|
||||
* Updated all sources and the amalgamated hosts file.
|
||||
* Update readme.md
|
||||
* Update the readme-template and, so, readme.md.
|
||||
* Deleted the otherData folder - not in use.
|
||||
* Issue #16: fix - Script is Python version 2.7.10
|
||||
* Latest consolidated hosts file, 26,385 entries.
|
||||
* Latest hosts files from all providers.
|
||||
* Issue #12: fix - refresh from adaway.org is failing with HTTPS so fallback to HTTP.
|
||||
* Issue #12: Adding the hosts from adaway.org.
|
||||
* MIT License. Fixes Issue #19.
|
||||
* Updated all data sources, and the amalgamated hosts file.
|
||||
* Merge pull request #11 from nomadturk/patch-2
|
||||
* Updated all the host-record sources, and generated a fresh consolidated hosts file.
|
||||
* Updated all input sources and merged into a new consolidated hosts file; 25803 items now.
|
||||
* Updated the hosts data from all sources, and updated the amalgamated hosts file.
|
||||
* Update update.info
|
||||
* Merge pull request #10 from nomadturk/patch-1
|
||||
* Update update.info
|
||||
* Issue #8: fix - Update the stripRule() function to be smarter about whitespace preceding comments. Thanks @caneylan.
|
||||
* Merge pull request #7 from borisschapira/master
|
||||
* Updated the hosts file with fresh data from all sources.
|
||||
* Updated the hosts file with fresh data from all sources.
|
||||
* Updated the hosts file with fresh data from all sources.
|
||||
* Updated data and the generated consolidated hosts file.
|
||||
* Removed hosts-file.net, too many false-positives.
|
||||
* Updated latest data
|
||||
* Updated hosts file now has 446,743 entries.
|
||||
* Merge branch 'linuxlefty-master'
|
||||
* (Ibid.)
|
||||
* Merge branch 'master' of https://github.com/linuxlefty/hosts into linuxlefty-master
|
||||
* Addeed mackeeperapp.zeobit.com to my set of bad domains.
|
||||
* livepassdl.conviva.com is required for streaming CBC Sports in Canada.
|
||||
* Latest update of all source files.
|
||||
* Normalizing hosts and better duplicate detction added
|
||||
* Added hpHosts (hosts-file.net) as a source
|
||||
* Added support for ZIP compressed files
|
||||
* Removing vim swap file
|
||||
* Added yoyo.org adserver lists as data source
|
||||
* Refreshed hosts from malwaredomainlist.com, mvps.org, and someonewhocares.org
|
||||
* Refreshed the hosts from http://malwaredomainlist.com/hosts and http://someonewhocares.org/hosts.
|
||||
* giving some love to readme.md
|
||||
* Updated the hosts file from all sources.
|
||||
* Updated all hosts, and the combined merged hosts file
|
||||
* Whoops, corrected an section that somehow went unresolved.
|
||||
* Merge branch 'master' of https://github.com/l1m5/hosts into l1m5-master
|
||||
* Source update.
|
||||
* Added query to user for moving the hosts file into place.
|
||||
* Source update.
|
||||
* Correcting syntax error with elif.
|
||||
* Added back instructions for Windows users on where to move their hosts file to. Resolves #5. I'm opening a new issue for adding this for Windows.
|
||||
* Added support for automatically moving the hosts file into place and flushing the DNS Cache for Mac and Linux. This addresses part of Issue #5, but I still need to do Windows.
|
||||
* Updated sources.
|
||||
* Write out how many unique entries were generated in the readme.md file. Resolves #3.
|
||||
* Updated the read me -- now it has 23,073 host entries.
|
||||
* Updates from all sources, and a new merge.
|
||||
* Print out copy locations on success. Now it's easy to copy/paste where the host file needs to go.
|
||||
* Updating sources
|
||||
* Source update.
|
||||
* Update sources.
|
||||
* Updated from sources.
|
||||
* Other data, not included in the processing, but under consideration for the future.
|
||||
* Updated with the latest from the Maleware Domain List and Someone Who Cares.
|
||||
* Updated sources.
|
||||
* Updated hosts files.
|
||||
* Update sources.
|
||||
* Updated sources and hosts file.
|
||||
* Updated readme file: 22,690 entries.
|
||||
* Updated amalgamated hosts file
|
||||
* Latest hosts file from mvps.org
|
||||
* Latest hosts file from malwaredomainlist.com
|
||||
* Fresh hosts file from someonewhocares.org
|
||||
* Source update.
|
||||
* Updated the readme to include a reference to malwaredomainlist.com.
|
||||
* Merge pull request #2 from l1m5/master
|
||||
* Updated README to include info on flushing DNS cache.
|
||||
* Updating with new entries from sources.
|
||||
* Colorized prompts for readability. This commit closes #2.
|
||||
* Resolves infinite loop error introduced in 997606b. Whether you entered yes or no to the "more entries" dialog, you'd still be in the loop. Also, we now check to see if the custom domain is blank
|
||||
* Woops, left debug logic in last commit.
|
||||
* Added ability to exclude domains. This commit closes #1. I always hated that Hulu would freak out when I generated a new hosts file. It checks to make sure that it can access its ad servers before it will start streaming. I'm assuming people have other sites similar to this, so the script now can be extended with common and custom domains to exclude.
|
||||
* Added new source malwaredomainlist.com. This source does not add much in the way of ad-blocking, but it a trusted source of malware domains.
|
||||
* New hosts file generated using script. This commit is the first merged hosts file to utilize the updateHostsFile.py script. The only working difference is that it pulled in a new someonewhocares.org hosts file.
|
||||
* Added script to handle updates to hosts sources. updateHostsFile.py can handle either simply combining local hosts files you have checked in, or it can go out to the Internet to update your source files. It also handles automatically generating a header and removing duplicates from the list.
|
||||
* New merge without duplicates -- these were commented-out previously
|
||||
* Latest merged hosts file.
|
||||
* Google analytics handled by someonewhocares.org host file
|
||||
* Jan 30th, 2013 hosts file from someonewhocares.org
|
||||
* January 2018 2013 hosts file from MVPs.org
|
||||
* Hosts file, Dec 26 2012 version, by Dan Pollock at http://someonewhocares.org/hosts/
|
||||
* Updated Readme. Now with 24,245 hosts listed.
|
||||
* Latest merged hosts file.
|
||||
* Latest MVPs hosts file
|
||||
* Latest hosts file
|
||||
* Latest merged hosts file.
|
||||
* Dan Pollock's latest version, Nov 3 2012.
|
||||
* Latest version available of the hosts from MVPs.org Oct 18 2012 version.
|
||||
* Readme: removed a style block.
|
||||
* Updated the readMe
|
||||
* Updated the readMe
|
||||
* This reverts commit cc759532b0d3c1461ac12d9e0ffb738c2d249e00.
|
||||
* Updated the readMe
|
||||
* Updated the readMe.
|
||||
* Added hosts file location for Android devices.
|
||||
* Docs are now the main readMe.
|
||||
* Added a rfirst eadMe to the repo.
|
||||
* Merge and deduce of all sources. Result: 22210 unique host entries.
|
||||
* Updated to the September 21 2012 version from http://someonewhocares.org/hosts/
|
||||
* Updated to the August 18th 2012 version of the MVPs host file.
|
||||
* Updating new hosts files from Dan and the MVPs.
|
||||
* Blocked ssl.google-analytics.com, which the MVPs block.
|
||||
* Latest merge.
|
||||
* Added twitter.cm as one of my peeves.
|
||||
* Promoted the output folder to the root. Added my own domains.
|
||||
* Hosts file from mvps.org, http://winhelp2002.mvps.org/hosts.txt, updated: March-30-2012
|
||||
* Hosts file from http://someonewhocares.org/hosts/ Last updated: Apr 11th, 2012
|
||||
* DOcs folder and first entry: hostsLocations.md
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# These create various alternate hosts files by combining and adding the gambling, porn, and social media extensions.
|
||||
python3 updateHostsFile.py -a -o alternates/gambling -e gambling
|
||||
python3 updateHostsFile.py -a -n -o alternates/porn -e porn
|
||||
python3 updateHostsFile.py -a -n -o alternates/social -e social
|
||||
python3 updateHostsFile.py -a -n -o alternates/gambling-porn -e gambling porn
|
||||
python3 updateHostsFile.py -a -n -o alternates/gambling-social -e gambling social
|
||||
python3 updateHostsFile.py -a -n -o alternates/porn-social -e porn social
|
||||
python3 updateHostsFile.py -a -n -o alternates/gambling-porn-social -e gambling porn social
|
||||
python3 updateHostsFile.py -a -n
|
||||
|
||||
# Update the readmes.
|
||||
python3 updateReadme.py
|
||||
@@ -1,17 +1,28 @@
|
||||
#Unified hosts file
|
||||
#Unified hosts file with base extensions
|
||||
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a single unified hosts file
|
||||
with duplicates removed.
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a unified hosts file
|
||||
with duplicates removed. This repo provides several hosts files tailored to you need to block.
|
||||
|
||||
**Expectation**: This unified hosts file should serve all devices, regardless of OS.
|
||||
* Last updated: **June 04 2016**.
|
||||
* Here's the [raw hosts file with base extensions](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) containing 27,050 entries.
|
||||
|
||||
* Last updated: **March 08 2016**.
|
||||
* Contains: **27,214 unique entries**.
|
||||
### List of all hosts file variants
|
||||
|
||||
You can [download the resultant unified hosts file](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts)
|
||||
or clone this repo and generate your own using the Python script provided.
|
||||
Host file recipe | Readme | Raw hosts | Unique domains
|
||||
---------------- |:------:|:---------:|:-------------:
|
||||
Unified hosts = **(adware + malware)** | [Readme](https://github.com/StevenBlack/hosts/blob/master/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) | 27,050
|
||||
Unified hosts **+ gambling** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts) | 27,764
|
||||
Unified hosts **+ porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts) | 32,323
|
||||
Unified hosts **+ social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts) | 27,280
|
||||
Unified hosts **+ gambling + porn** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts) | 33,037
|
||||
Unified hosts **+ gambling + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-social/hosts) | 27,994
|
||||
Unified hosts **+ porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn-social/hosts) | 32,553
|
||||
Unified hosts **+ gambling + porn + social** | [Readme](https://github.com/StevenBlack/hosts/blob/master/alternates/gambling-porn-social/readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts) | 33,267
|
||||
|
||||
## Sources of host data unified here
|
||||
|
||||
**Expectation**: These unified hosts files should serve all devices, regardless of OS.
|
||||
|
||||
## Sources of hosts data unified here
|
||||
|
||||
Updated `hosts` files from the following locations are always unified and included:
|
||||
|
||||
@@ -24,7 +35,7 @@ monthly, or thereabouts.
|
||||
* My own small list in raw form [here](https://raw.github.com/StevenBlack/hosts/master/data/StevenBlack/hosts).
|
||||
|
||||
## Extensions
|
||||
The unified hosts file is extensible . You manage extensions by curating the `extensions/` folder tree.
|
||||
The unified hosts file is extensible. You manage extensions by curating the `extensions/` folder tree.
|
||||
See the `social`, `gambling`, and `porn` extension which are included in this repo, for example.
|
||||
|
||||
## Generate your own unified hosts file
|
||||
@@ -46,41 +57,64 @@ versions (from locations defined by the update.info text file in each source's f
|
||||
|
||||
#### Command line options:
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
`--auto`, or `-a`: run the script without prompting. When `--auto` is invoked,
|
||||
|
||||
* Host data sources, including extensions, are updated.
|
||||
* Hosts data sources, including extensions, are updated.
|
||||
* No extensions are included by default. Use the `--extensions` or `-e` flag to include any you want.
|
||||
* Your active hosts file is *not* replaced unless you include the `--replace` flag.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts file with the new hosts file. Use along with `--auto` to
|
||||
force replacement.
|
||||
`--backup`, or `-b`: Make a backup of existing hosts file(s) as you generate over them.
|
||||
|
||||
`--extensions <ext1> <ext2> <ext3>`, or `-e <ext1> <ext2> <ext3>`: the names of subfolders below the `extensions` folder
|
||||
containing additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or
|
||||
`-e social porn`.
|
||||
|
||||
`--ip nnn.nnn.nnn.nnn`, or `-i nnn.nnn.nnn.nnn`: the IP address to use as the target. Default is `0.0.0.0`.
|
||||
|
||||
`--extensions ext1 ext2 ext3`, or `-e ext1 ext2 ext3`: the names of subfolders below the `extensions` folder containing
|
||||
additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or `-e social porn`.
|
||||
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
|
||||
|
||||
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file in a subfolder. If the subfolder does not
|
||||
exist, it will be created.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts
|
||||
|
||||
`--skipstatichosts`, or `-s`: `false` (default) or `true`, omit the standard section, at the top containing lines like `127.0.0.1 localhost`. This is useful for configuring proximate DNS services on the local network.
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
## How do I control which sources are unified?
|
||||
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
`update.info` file.
|
||||
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
`update.info` controls where this extension finds its updates.
|
||||
|
||||
## How do I incorporate my own hosts?
|
||||
### How do I include my own custom domain mappings?
|
||||
|
||||
If you have custom host records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
If you have custom hosts records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
unified hosts file during the update process.
|
||||
|
||||
The `myhosts` file is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo from `origin` in the future.
|
||||
|
||||
### How do I prevent domains from being included?
|
||||
|
||||
The domains you list in the `whitelist` file are excluded from the final hosts file.
|
||||
|
||||
The `whitelist` uses partial matching. Therefore if you whitelist `google-analytics.com`, that domain and all its
|
||||
subdomains won't be merged into the final hosts file.
|
||||
|
||||
The `whitelist` is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo
|
||||
from `origin` in the future.
|
||||
|
||||
|
||||
## What is a hosts file?
|
||||
|
||||
A hosts file, named `hosts` (with no file extension), is a plain-text file used by all operating
|
||||
systems to map hostnames to IP addresses.
|
||||
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a host name is
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a domain name is
|
||||
resolved by the `hosts` file, the request never leaves your computer.
|
||||
|
||||
Having a smart `hosts` file goes a long way towards blocking malware, adware, and other irritants.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"gambling": {"entries": 27764, "location": "alternates/gambling/"}, "gambling-porn": {"entries": 33037, "location": "alternates/gambling-porn/"}, "porn": {"entries": 32323, "location": "alternates/porn/"}, "porn-social": {"entries": 32553, "location": "alternates/porn-social/"}, "gambling-social": {"entries": 27994, "location": "alternates/gambling-social/"}, "base": {"entries": 27050, "location": ""}, "social": {"entries": 27280, "location": "alternates/social/"}, "gambling-porn-social": {"entries": 33267, "location": "alternates/gambling-porn-social/"}}
|
||||
+47
-21
@@ -1,17 +1,20 @@
|
||||
#Unified hosts file
|
||||
#Unified hosts file @EXTENSIONS_HEADER@
|
||||
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a single unified hosts file
|
||||
with duplicates removed.
|
||||
|
||||
**Expectation**: This unified hosts file should serve all devices, regardless of OS.
|
||||
This repository consolidates several reputable `hosts` files, and merges them into a unified hosts file
|
||||
with duplicates removed. This repo provides several hosts files tailored to you need to block.
|
||||
|
||||
* Last updated: **@GEN_DATE@**.
|
||||
* Contains: **@NUM_ENTRIES@ unique entries**.
|
||||
* Here's the [raw hosts file @EXTENSIONS_HEADER@](https://raw.githubusercontent.com/StevenBlack/hosts/master/@SUBFOLDER@hosts) containing @NUM_ENTRIES@ entries.
|
||||
|
||||
You can [download the resultant unified hosts file](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts)
|
||||
or clone this repo and generate your own using the Python script provided.
|
||||
### List of all hosts file variants
|
||||
|
||||
## Sources of host data unified here
|
||||
Host file recipe | Readme | Raw hosts | Unique domains
|
||||
---------------- |:------:|:---------:|:-------------:
|
||||
@TOCROWS@
|
||||
|
||||
**Expectation**: These unified hosts files should serve all devices, regardless of OS.
|
||||
|
||||
## Sources of hosts data unified here
|
||||
|
||||
Updated `hosts` files from the following locations are always unified and included:
|
||||
|
||||
@@ -24,7 +27,7 @@ monthly, or thereabouts.
|
||||
* My own small list in raw form [here](https://raw.github.com/StevenBlack/hosts/master/data/StevenBlack/hosts).
|
||||
|
||||
## Extensions
|
||||
The unified hosts file is extensible . You manage extensions by curating the `extensions/` folder tree.
|
||||
The unified hosts file is extensible. You manage extensions by curating the `extensions/` folder tree.
|
||||
See the `social`, `gambling`, and `porn` extension which are included in this repo, for example.
|
||||
|
||||
## Generate your own unified hosts file
|
||||
@@ -46,41 +49,64 @@ versions (from locations defined by the update.info text file in each source's f
|
||||
|
||||
#### Command line options:
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
`--auto`, or `-a`: run the script without prompting. When `--auto` is invoked,
|
||||
|
||||
* Host data sources, including extensions, are updated.
|
||||
* Hosts data sources, including extensions, are updated.
|
||||
* No extensions are included by default. Use the `--extensions` or `-e` flag to include any you want.
|
||||
* Your active hosts file is *not* replaced unless you include the `--replace` flag.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts file with the new hosts file. Use along with `--auto` to
|
||||
force replacement.
|
||||
`--backup`, or `-b`: Make a backup of existing hosts file(s) as you generate over them.
|
||||
|
||||
`--extensions <ext1> <ext2> <ext3>`, or `-e <ext1> <ext2> <ext3>`: the names of subfolders below the `extensions` folder
|
||||
containing additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or
|
||||
`-e social porn`.
|
||||
|
||||
`--ip nnn.nnn.nnn.nnn`, or `-i nnn.nnn.nnn.nnn`: the IP address to use as the target. Default is `0.0.0.0`.
|
||||
|
||||
`--extensions ext1 ext2 ext3`, or `-e ext1 ext2 ext3`: the names of subfolders below the `extensions` folder containing
|
||||
additional category-specific hosts files to include in the amalgamation. Example: `--extensions porn` or `-e social porn`.
|
||||
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
|
||||
|
||||
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file in a subfolder. If the subfolder does not
|
||||
exist, it will be created.
|
||||
|
||||
`--replace`, or `-r`: trigger replacing your active hosts
|
||||
|
||||
`--skipstatichosts`, or `-s`: `false` (default) or `true`, omit the standard section, at the top containing lines like `127.0.0.1 localhost`. This is useful for configuring proximate DNS services on the local network.
|
||||
|
||||
`--help`, or `-h`: display help.
|
||||
|
||||
## How do I control which sources are unified?
|
||||
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
Add one or more *additional* sources, each in a subfolder of the `data/` folder, and specify its update url in
|
||||
`update.info` file.
|
||||
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
Add one or more *optional* extensions, which originate from subfolders of the `extensions/` folder. Again the url in
|
||||
`update.info` controls where this extension finds its updates.
|
||||
|
||||
## How do I incorporate my own hosts?
|
||||
### How do I include my own custom domain mappings?
|
||||
|
||||
If you have custom host records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
If you have custom hosts records, place them in file `myhosts`. The contents of this file are prepended to the
|
||||
unified hosts file during the update process.
|
||||
|
||||
The `myhosts` file is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo from `origin` in the future.
|
||||
|
||||
### How do I prevent domains from being included?
|
||||
|
||||
The domains you list in the `whitelist` file are excluded from the final hosts file.
|
||||
|
||||
The `whitelist` uses partial matching. Therefore if you whitelist `google-analytics.com`, that domain and all its
|
||||
subdomains won't be merged into the final hosts file.
|
||||
|
||||
The `whitelist` is not tracked by git, so any changes you make won't be overridden when you `git pull` this repo
|
||||
from `origin` in the future.
|
||||
|
||||
|
||||
## What is a hosts file?
|
||||
|
||||
A hosts file, named `hosts` (with no file extension), is a plain-text file used by all operating
|
||||
systems to map hostnames to IP addresses.
|
||||
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a host name is
|
||||
In most operating systems, the `hosts` file is preferential to `DNS`. Therefore if a domain name is
|
||||
resolved by the `hosts` file, the request never leaves your computer.
|
||||
|
||||
Having a smart `hosts` file goes a long way towards blocking malware, adware, and other irritants.
|
||||
|
||||
+227
-180
@@ -23,20 +23,30 @@ import tempfile
|
||||
import time
|
||||
import glob
|
||||
import argparse
|
||||
import socket
|
||||
import json
|
||||
|
||||
# zip files are not used actually, support deleted
|
||||
# StringIO is not needed in Python 3
|
||||
# Python 3 works differently with urlopen
|
||||
|
||||
# Supporting urlopen in Python 2 and Python 3
|
||||
try:
|
||||
try: # Python 3
|
||||
from urllib.parse import urlparse, urlencode
|
||||
from urllib.request import urlopen, Request
|
||||
from urllib.error import HTTPError
|
||||
except ImportError:
|
||||
except ImportError: # Python 2
|
||||
from urlparse import urlparse
|
||||
from urllib import urlencode
|
||||
from urllib2 import urlopen, Request, HTTPError
|
||||
|
||||
try: # Python 2
|
||||
raw_input
|
||||
except NameError: # Python 3
|
||||
raw_input = input
|
||||
|
||||
# Detecting Python 3 for version-dependent implementations
|
||||
Python3 = sys.version_info >= (3,0)
|
||||
|
||||
# This function handles both Python 2 and Python 3
|
||||
def getFileByUrl(url):
|
||||
try:
|
||||
@@ -48,74 +58,77 @@ def getFileByUrl(url):
|
||||
|
||||
# In Python 3 "print" is a function, braces are added everywhere
|
||||
|
||||
# Detecting Python 3 for version-dependent implementations
|
||||
Python3 = False
|
||||
cur_version = sys.version_info
|
||||
if cur_version >= (3, 0):
|
||||
Python3 = True
|
||||
|
||||
# This function works in both Python 2 and Python 3
|
||||
def myInput(msg = ""):
|
||||
if Python3:
|
||||
return input(msg)
|
||||
else:
|
||||
return raw_input(msg)
|
||||
|
||||
# Cross-python writing function
|
||||
def writeData(f, data):
|
||||
if Python3:
|
||||
f.write(bytes(data, 'UTF-8'))
|
||||
f.write(bytes(data, "UTF-8"))
|
||||
else:
|
||||
f.write(str(data).encode('UTF-8'))
|
||||
f.write(str(data).encode("UTF-8"))
|
||||
|
||||
# This function doesn't list hidden files
|
||||
def listdir_nohidden(path):
|
||||
return glob.glob(os.path.join(path, '*'))
|
||||
return glob.glob(os.path.join(path, "*"))
|
||||
|
||||
# Project Settings
|
||||
BASEDIR_PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
DATA_PATH = os.path.join(BASEDIR_PATH, 'data')
|
||||
EXTENSIONS_PATH = os.path.join(BASEDIR_PATH, 'extensions')
|
||||
DATA_FILENAMES = 'hosts'
|
||||
UPDATE_URL_FILENAME = 'update.info'
|
||||
SOURCES = listdir_nohidden(DATA_PATH)
|
||||
EXTENSIONS = listdir_nohidden(EXTENSIONS_PATH)
|
||||
README_TEMPLATE = os.path.join(BASEDIR_PATH, 'readme_template.md')
|
||||
README_FILE = os.path.join(BASEDIR_PATH, 'readme.md')
|
||||
WHITELIST_FILE = os.path.join(BASEDIR_PATH, 'whitelist')
|
||||
BASEDIR_PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
# Exclusions
|
||||
EXCLUSION_PATTERN = '([a-zA-Z\d-]+\.){0,}' #append domain the end
|
||||
EXCLUSIONS = []
|
||||
# Common domains to exclude
|
||||
COMMON_EXCLUSIONS = ['hulu.com']
|
||||
|
||||
# Global vars
|
||||
exclusionRegexs = []
|
||||
numberOfRules = 0
|
||||
auto = False
|
||||
replace = False
|
||||
targetIP = "0.0.0.0"
|
||||
extensions = []
|
||||
defaults = {
|
||||
"numberofrules" : 0,
|
||||
"datapath" : os.path.join(BASEDIR_PATH, "data"),
|
||||
"freshen" : True,
|
||||
"replace" : False,
|
||||
"backup" : False,
|
||||
"skipstatichosts": False,
|
||||
"extensionspath" : os.path.join(BASEDIR_PATH, "extensions"),
|
||||
"extensions" : [],
|
||||
"outputsubfolder" : "",
|
||||
"datafilenames" : "hosts",
|
||||
"targetip" : "0.0.0.0",
|
||||
"updateurlfilename" : "update.info",
|
||||
"readmefilename" : "readme.md",
|
||||
"readmetemplate" : os.path.join(BASEDIR_PATH, "readme_template.md"),
|
||||
"readmedata" : {},
|
||||
"readmedatafilename" : os.path.join(BASEDIR_PATH, "readmeData.json"),
|
||||
"exclusionpattern" : "([a-zA-Z\d-]+\.){0,}",
|
||||
"exclusionregexs" : [],
|
||||
"exclusions" : [],
|
||||
"commonexclusions" : ["hulu.com"],
|
||||
"whitelistfile" : os.path.join(BASEDIR_PATH, "whitelist")}
|
||||
|
||||
def main():
|
||||
|
||||
parser = argparse.ArgumentParser(description="Creates a unified hosts file from hosts stored in data subfolders.")
|
||||
parser.add_argument("--auto", "-a", dest="auto", default=False, action='store_true', help="Run without prompting.")
|
||||
parser.add_argument("--replace", "-r", dest="replace", default=False, action='store_true', help="Replace your active hosts file with this new hosts file.")
|
||||
parser.add_argument("--ip", "-i", dest="targetIP", default="0.0.0.0", help="Target IP address. Default is 0.0.0.0.")
|
||||
parser.add_argument("--extensions", "-e", dest="extensions", default=[], nargs='*', help="Host extensions to include in the final hosts file.")
|
||||
args = parser.parse_args()
|
||||
parser.add_argument("--auto", "-a", dest="auto", default=False, action="store_true", help="Run without prompting.")
|
||||
parser.add_argument("--backup", "-b", dest="backup", default=False, action="store_true", help="Backup the hosts files before they are overridden.")
|
||||
parser.add_argument("--extensions", "-e", dest="extensions", default=[], nargs="*", help="Host extensions to include in the final hosts file.")
|
||||
parser.add_argument("--ip", "-i", dest="targetip", default="0.0.0.0", help="Target IP address. Default is 0.0.0.0.")
|
||||
parser.add_argument("--noupdate", "-n", dest="noupdate", default=False, action="store_true", help="Don't update from host data sources.")
|
||||
parser.add_argument("--skipstatichosts", "-s", dest="skipstatichosts", default=False, action="store_true", help="Skip static localhost entries in the final hosts file.")
|
||||
parser.add_argument("--output", "-o", dest="outputsubfolder", default="", help="Output subfolder for generated hosts file.")
|
||||
parser.add_argument("--replace", "-r", dest="replace", default=False, action="store_true", help="Replace your active hosts file with this new hosts file.")
|
||||
|
||||
global settings
|
||||
|
||||
options = vars(parser.parse_args())
|
||||
|
||||
options["outputpath"] = os.path.join(BASEDIR_PATH, options["outputsubfolder"])
|
||||
options["freshen"] = not options["noupdate"]
|
||||
|
||||
settings = {}
|
||||
settings.update(defaults)
|
||||
settings.update(options)
|
||||
|
||||
settings["sources"] = listdir_nohidden(settings["datapath"])
|
||||
settings["extensionsources"] = listdir_nohidden(settings["extensionspath"])
|
||||
|
||||
global auto, targetIP, extensions, replace
|
||||
auto = args.auto
|
||||
replace = args.replace
|
||||
targetIP = args.targetIP
|
||||
|
||||
# All our extensions folders...
|
||||
extensions = [os.path.basename(item) for item in listdir_nohidden(EXTENSIONS_PATH)]
|
||||
# ... intersected with the extensions passed-in as arguments
|
||||
extensions = list(set(args.extensions).intersection(extensions))
|
||||
settings["extensions"] = [os.path.basename(item) for item in listdir_nohidden(settings["extensionspath"])]
|
||||
# ... intersected with the extensions passed-in as arguments, then sorted.
|
||||
settings["extensions"] = sorted( list(set(options["extensions"]).intersection(settings["extensions"])) )
|
||||
|
||||
with open(settings["readmedatafilename"], "r") as f:
|
||||
settings["readmedata"] = json.load(f)
|
||||
|
||||
promptForUpdate()
|
||||
promptForExclusions()
|
||||
@@ -123,51 +136,50 @@ def main():
|
||||
removeOldHostsFile()
|
||||
finalFile = removeDupsAndExcl(mergeFile)
|
||||
finalizeFile(finalFile)
|
||||
updateReadme(numberOfRules)
|
||||
printSuccess('Success! Your new hosts file has been prepared.\nIt contains ' +
|
||||
"{:,}".format(numberOfRules) + ' unique entries.')
|
||||
updateReadmeData()
|
||||
printSuccess("Success! The hosts file has been saved in folder " + settings["outputsubfolder"] + "\nIt contains " +
|
||||
"{:,}".format(settings["numberofrules"]) + " unique entries.")
|
||||
|
||||
promptForMove(finalFile)
|
||||
|
||||
# Prompt the User
|
||||
def promptForUpdate():
|
||||
# Create hosts file if it doesn't exists
|
||||
if not os.path.isfile(os.path.join(BASEDIR_PATH, 'hosts')):
|
||||
if not os.path.isfile(os.path.join(BASEDIR_PATH, "hosts")):
|
||||
try:
|
||||
open(os.path.join(BASEDIR_PATH, 'hosts'), 'w+').close()
|
||||
open(os.path.join(BASEDIR_PATH, "hosts"), "w+").close()
|
||||
except:
|
||||
printFailure("ERROR: No 'hosts' file in the folder, try creating one manually")
|
||||
|
||||
response = "yes" if auto else query_yes_no("Do you want to update all data sources?")
|
||||
if not settings["freshen"]:
|
||||
return
|
||||
|
||||
response = "yes" if settings["auto"] else query_yes_no("Do you want to update all data sources?")
|
||||
if response == "yes":
|
||||
updateAllSources()
|
||||
else:
|
||||
if not auto:
|
||||
print ("OK, we\'ll stick with what we\'ve got locally.")
|
||||
if not settings["auto"]:
|
||||
print ("OK, we'll stick with what we've got locally.")
|
||||
|
||||
def promptForExclusions():
|
||||
response = "no" if auto else query_yes_no("Do you want to exclude any domains?\n" +
|
||||
response = "no" if settings["auto"] else query_yes_no("Do you want to exclude any domains?\n" +
|
||||
"For example, hulu.com video streaming must be able to access " +
|
||||
"its tracking and ad servers in order to play video.")
|
||||
if response == "yes":
|
||||
displayExclusionOptions()
|
||||
else:
|
||||
if not auto:
|
||||
print ("OK, we\'ll only exclude domains in the whitelist.")
|
||||
if not settings["auto"]:
|
||||
print ("OK, we'll only exclude domains in the whitelist.")
|
||||
|
||||
def promptForMoreCustomExclusions():
|
||||
response = query_yes_no("Do you have more domains you want to enter?")
|
||||
if response == "yes":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
def promptForMoreCustomExclusions(question="Do you have more domains you want to enter?"):
|
||||
return query_yes_no(question) == "yes"
|
||||
|
||||
def promptForMove(finalFile):
|
||||
|
||||
if replace:
|
||||
if settings["replace"] and not settings["skipstatichosts"]:
|
||||
response = "yes"
|
||||
else:
|
||||
response = "no" if auto else query_yes_no("Do you want to replace your existing hosts file " +
|
||||
response = "no" if settings["auto"] or settings["skipstatichosts"] else query_yes_no("Do you want to replace your existing hosts file " +
|
||||
"with the newly generated file?")
|
||||
if response == "yes":
|
||||
moveHostsFileIntoPlace(finalFile)
|
||||
@@ -177,7 +189,7 @@ def promptForMove(finalFile):
|
||||
|
||||
# Exclusion logic
|
||||
def displayExclusionOptions():
|
||||
for exclusionOption in COMMON_EXCLUSIONS:
|
||||
for exclusionOption in settings["commonexclusions"]:
|
||||
response = query_yes_no("Do you want to exclude the domain " + exclusionOption + " ?")
|
||||
if response == "yes":
|
||||
excludeDomain(exclusionOption)
|
||||
@@ -190,18 +202,18 @@ def displayExclusionOptions():
|
||||
def gatherCustomExclusions():
|
||||
while True:
|
||||
# Cross-python Input
|
||||
domainFromUser = myInput("Enter the domain you want to exclude (e.g. facebook.com): ")
|
||||
domainFromUser = raw_input("Enter the domain you want to exclude (e.g. facebook.com): ")
|
||||
if isValidDomainFormat(domainFromUser):
|
||||
excludeDomain(domainFromUser)
|
||||
if promptForMoreCustomExclusions() is False:
|
||||
if not promptForMoreCustomExclusions():
|
||||
return
|
||||
|
||||
def excludeDomain(domain):
|
||||
exclusionRegexs.append(re.compile(EXCLUSION_PATTERN + domain))
|
||||
settings["exclusionregexs"].append(re.compile(settings["exclusionpattern"] + domain))
|
||||
|
||||
def matchesExclusions(strippedRule):
|
||||
strippedDomain = strippedRule.split()[1]
|
||||
for exclusionRegex in exclusionRegexs:
|
||||
for exclusionRegex in settings["exclusionregexs"]:
|
||||
if exclusionRegex.search(strippedDomain):
|
||||
return True
|
||||
return False
|
||||
@@ -209,115 +221,113 @@ def matchesExclusions(strippedRule):
|
||||
|
||||
# Update Logic
|
||||
def updateAllSources():
|
||||
allsources = list(set(SOURCES) | set(EXTENSIONS))
|
||||
allsources = list(set(settings["sources"]) | set(settings["extensionsources"]))
|
||||
for source in allsources:
|
||||
if os.path.isdir(source):
|
||||
updateURLs = getUpdateURLsFromFile(source)
|
||||
if not len(updateURLs):
|
||||
continue
|
||||
|
||||
for updateURL in updateURLs:
|
||||
for updateURL in getUpdateURLsFromFile(source):
|
||||
print ("Updating source " + os.path.basename(source) + " from " + updateURL)
|
||||
# Cross-python call
|
||||
updatedFile = getFileByUrl(updateURL)
|
||||
try:
|
||||
updatedFile = updatedFile.replace('\r', '') #get rid of carriage-return symbols
|
||||
updatedFile = updatedFile.replace("\r", "") #get rid of carriage-return symbols
|
||||
# This is cross-python code
|
||||
dataFile = open(os.path.join(DATA_PATH, source, DATA_FILENAMES), 'wb')
|
||||
dataFile = open(os.path.join(settings["datapath"], source, settings["datafilenames"]), "wb")
|
||||
writeData(dataFile, updatedFile)
|
||||
dataFile.close()
|
||||
except:
|
||||
print ("Skipping.")
|
||||
|
||||
def getUpdateURLsFromFile(source):
|
||||
pathToUpdateFile = os.path.join(DATA_PATH, source, UPDATE_URL_FILENAME)
|
||||
pathToUpdateFile = os.path.join(settings["datapath"], source, settings["updateurlfilename"])
|
||||
if os.path.exists(pathToUpdateFile):
|
||||
updateFile = open(pathToUpdateFile, 'r')
|
||||
updateFile = open(pathToUpdateFile, "r")
|
||||
retURLs = updateFile.readlines()
|
||||
# .strip()
|
||||
updateFile.close()
|
||||
else:
|
||||
retURL = None
|
||||
printFailure('Warning: Can\'t find the update file for source ' + source + '\n' +
|
||||
'Make sure that there\'s a file at ' + pathToUpdateFile)
|
||||
printFailure("Warning: Can't find the update file for source " + source + "\n" +
|
||||
"Make sure that there's a file at " + pathToUpdateFile)
|
||||
return retURLs
|
||||
# End Update Logic
|
||||
|
||||
|
||||
def getUpdateURLFromFile(source):
|
||||
pathToUpdateFile = os.path.join(DATA_PATH, source, UPDATE_URL_FILENAME)
|
||||
pathToUpdateFile = os.path.join(settings["datapath"], source, settings["updateurlfilename"])
|
||||
if os.path.exists(pathToUpdateFile):
|
||||
updateFile = open(pathToUpdateFile, 'r')
|
||||
retURL = updateFile.readline().strip()
|
||||
updateFile.close()
|
||||
else:
|
||||
retURL = None
|
||||
printFailure('Warning: Can\'t find the update file for source ' + source + '\n' +
|
||||
'Make sure that there\'s a file at ' + pathToUpdateFile)
|
||||
return retURL
|
||||
with open(pathToUpdateFile, "r") as updateFile:
|
||||
return updateFile.readline().strip()
|
||||
printFailure("Warning: Can't find the update file for source " + source + "\n" +
|
||||
"Make sure that there's a file at " + pathToUpdateFile)
|
||||
return None
|
||||
# End Update Logic
|
||||
|
||||
# File Logic
|
||||
def createInitialFile():
|
||||
mergeFile = tempfile.NamedTemporaryFile()
|
||||
for source in SOURCES:
|
||||
curFile = open(os.path.join(DATA_PATH, source, DATA_FILENAMES), 'r')
|
||||
#Done in a cross-python way
|
||||
writeData(mergeFile, curFile.read())
|
||||
for source in settings["sources"]:
|
||||
filename = os.path.join(settings["datapath"], source, settings["datafilenames"])
|
||||
with open(filename, "r") as curFile:
|
||||
#Done in a cross-python way
|
||||
writeData(mergeFile, curFile.read())
|
||||
|
||||
for source in extensions:
|
||||
curFile = open(os.path.join(EXTENSIONS_PATH, source, DATA_FILENAMES), 'r')
|
||||
#Done in a cross-python way
|
||||
writeData(mergeFile, curFile.read())
|
||||
for source in settings["extensions"]:
|
||||
filename = os.path.join(settings["extensionspath"], source, settings["datafilenames"])
|
||||
with open(filename, "r") as curFile:
|
||||
#Done in a cross-python way
|
||||
writeData(mergeFile, curFile.read())
|
||||
|
||||
return mergeFile
|
||||
|
||||
def removeDupsAndExcl(mergeFile):
|
||||
global numberOfRules
|
||||
if os.path.isfile(WHITELIST_FILE):
|
||||
with open(WHITELIST_FILE, "r") as ins:
|
||||
numberOfRules = settings["numberofrules"]
|
||||
if os.path.isfile(settings["whitelistfile"]):
|
||||
with open(settings["whitelistfile"], "r") as ins:
|
||||
for line in ins:
|
||||
if line.rstrip():
|
||||
EXCLUSIONS.append(line)
|
||||
line = line.strip(" \t\n\r")
|
||||
if line and not line.startswith("#"):
|
||||
settings["exclusions"].append(line)
|
||||
|
||||
if not os.path.exists(settings["outputpath"]):
|
||||
os.makedirs(settings["outputpath"])
|
||||
|
||||
# Another mode is required to read and write the file in Python 3
|
||||
finalFile = open(os.path.join(BASEDIR_PATH, 'hosts'), 'r+b')
|
||||
mergeFile.seek(0) # reset file pointer
|
||||
finalFile = open(os.path.join(settings["outputpath"], "hosts"),
|
||||
"w+b" if Python3 else "w+")
|
||||
|
||||
hostnames = set()
|
||||
hostnames.add("localhost")
|
||||
hostnames.add("localhost.localdomain")
|
||||
hostnames.add("local")
|
||||
hostnames.add("broadcasthost")
|
||||
mergeFile.seek(0) # reset file pointer
|
||||
hostnames = set(["localhost", "localhost.localdomain", "local", "broadcasthost"])
|
||||
exclusions = settings["exclusions"]
|
||||
for line in mergeFile.readlines():
|
||||
write = 'true'
|
||||
write = "true"
|
||||
# Explicit encoding
|
||||
line = line.decode("UTF-8")
|
||||
# replace tabs with space
|
||||
line = line.replace('\t+', ' ')
|
||||
line = line.replace("\t+", " ")
|
||||
# Trim trailing whitespace
|
||||
line = line.rstrip() + "\n"
|
||||
# Testing the first character doesn't require startswith
|
||||
if line[0] == '#' or re.match(r'^\s*$', line[0]):
|
||||
if line[0] == "#" or re.match(r'^\s*$', line[0]):
|
||||
# Cross-python write
|
||||
writeData(finalFile, line)
|
||||
continue
|
||||
if '::1' in line:
|
||||
if "::1" in line:
|
||||
continue
|
||||
|
||||
strippedRule = stripRule(line) #strip comments
|
||||
if len(strippedRule) == 0:
|
||||
continue
|
||||
if matchesExclusions(strippedRule):
|
||||
if not strippedRule or matchesExclusions(strippedRule):
|
||||
continue
|
||||
hostname, normalizedRule = normalizeRule(strippedRule) # normalize rule
|
||||
for exclude in EXCLUSIONS:
|
||||
for exclude in exclusions:
|
||||
if exclude in line:
|
||||
write = 'false'
|
||||
write = "false"
|
||||
break
|
||||
if normalizedRule and (hostname not in hostnames) and (write == 'true'):
|
||||
if normalizedRule and (hostname not in hostnames) and (write == "true"):
|
||||
writeData(finalFile, normalizedRule)
|
||||
hostnames.add(hostname)
|
||||
numberOfRules += 1
|
||||
|
||||
settings["numberofrules"] = numberOfRules
|
||||
mergeFile.close()
|
||||
|
||||
return finalFile
|
||||
@@ -327,11 +337,11 @@ def normalizeRule(rule):
|
||||
if result:
|
||||
hostname, suffix = result.group(2,3)
|
||||
hostname = hostname.lower().strip() # explicitly lowercase and trim the hostname
|
||||
if suffix is not '':
|
||||
if suffix:
|
||||
# add suffix as comment only, not as a separate host
|
||||
return hostname, "%s %s #%s\n" % (targetIP, hostname, suffix)
|
||||
return hostname, "%s %s #%s\n" % (settings["targetip"], hostname, suffix)
|
||||
else:
|
||||
return hostname, "%s %s\n" % (targetIP, hostname)
|
||||
return hostname, "%s %s\n" % (settings["targetip"], hostname)
|
||||
print ("==>%s<==" % rule)
|
||||
return None, None
|
||||
|
||||
@@ -345,29 +355,35 @@ def stripRule(line):
|
||||
splitLine = line.split()
|
||||
if len(splitLine) < 2 :
|
||||
# just return blank
|
||||
return ''
|
||||
return ""
|
||||
else:
|
||||
return splitLine[0] + ' ' + splitLine[1]
|
||||
return splitLine[0] + " " + splitLine[1]
|
||||
|
||||
def writeOpeningHeader(finalFile):
|
||||
global numberOfRules
|
||||
finalFile.seek(0) #reset file pointer
|
||||
fileContents = finalFile.read() #save content
|
||||
finalFile.seek(0) #write at the top
|
||||
writeData(finalFile, '# This hosts file is a merged collection of hosts from reputable sources,\n')
|
||||
writeData(finalFile, '# with a dash of crowd sourcing via Github\n#\n')
|
||||
writeData(finalFile, '# Date: ' + time.strftime("%B %d %Y", time.gmtime()) + '\n#\n')
|
||||
writeData(finalFile, '# Fetch the latest version of this file: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts\n')
|
||||
writeData(finalFile, '# Project home page: https://github.com/StevenBlack/hosts\n#\n')
|
||||
writeData(finalFile, '# ===============================================================\n')
|
||||
writeData(finalFile, '\n')
|
||||
writeData(finalFile, '127.0.0.1 localhost\n')
|
||||
writeData(finalFile, '127.0.0.1 localhost.localdomain\n')
|
||||
writeData(finalFile, '127.0.0.1 local\n')
|
||||
writeData(finalFile, '255.255.255.255 broadcasthost\n')
|
||||
writeData(finalFile, '::1 localhost\n')
|
||||
writeData(finalFile, 'fe80::1%lo0 localhost\n')
|
||||
writeData(finalFile, '\n')
|
||||
writeData(finalFile, "# This hosts file is a merged collection of hosts from reputable sources,\n")
|
||||
writeData(finalFile, "# with a dash of crowd sourcing via Github\n#\n")
|
||||
writeData(finalFile, "# Date: " + time.strftime("%B %d %Y", time.gmtime()) + "\n")
|
||||
if settings["extensions"]:
|
||||
writeData(finalFile, "# Extensions added to this file: " + ", ".join(settings["extensions"]) + "\n")
|
||||
writeData(finalFile, "# Number of unique domains: " + "{:,}\n#\n".format(settings["numberofrules"]))
|
||||
writeData(finalFile, "# Fetch the latest version of this file: https://raw.githubusercontent.com/StevenBlack/hosts/master/"+ os.path.join(settings["outputsubfolder"],"") + "hosts\n")
|
||||
writeData(finalFile, "# Project home page: https://github.com/StevenBlack/hosts\n#\n")
|
||||
writeData(finalFile, "# ===============================================================\n")
|
||||
writeData(finalFile, "\n")
|
||||
|
||||
if not settings["skipstatichosts"]:
|
||||
writeData(finalFile, "127.0.0.1 localhost\n")
|
||||
writeData(finalFile, "127.0.0.1 localhost.localdomain\n")
|
||||
writeData(finalFile, "127.0.0.1 local\n")
|
||||
writeData(finalFile, "255.255.255.255 broadcasthost\n")
|
||||
writeData(finalFile, "::1 localhost\n")
|
||||
writeData(finalFile, "fe80::1%lo0 localhost\n")
|
||||
if platform.system() == "Linux":
|
||||
writeData(finalFile, "127.0.1.1 " + socket.gethostname() + "\n")
|
||||
writeData(finalFile, "\n")
|
||||
|
||||
preamble = os.path.join(BASEDIR_PATH, "myhosts")
|
||||
if os.path.isfile(preamble):
|
||||
@@ -376,43 +392,77 @@ def writeOpeningHeader(finalFile):
|
||||
|
||||
finalFile.write(fileContents)
|
||||
|
||||
def updateReadme(numberOfRules):
|
||||
with open(README_FILE, "wt") as out:
|
||||
for line in open(README_TEMPLATE):
|
||||
line = line.replace( '@GEN_DATE@', time.strftime("%B %d %Y", time.gmtime()))
|
||||
out.write(line.replace('@NUM_ENTRIES@', "{:,}".format(numberOfRules)))
|
||||
def updateReadmeData():
|
||||
extensionsKey = "base"
|
||||
hostsLocation = ""
|
||||
if settings["extensions"]:
|
||||
extensionsKey = "-".join(settings["extensions"])
|
||||
|
||||
generationData = {"location": os.path.join(settings["outputsubfolder"], ""),
|
||||
"entries": settings["numberofrules"]}
|
||||
settings["readmedata"][extensionsKey] = generationData
|
||||
with open(settings["readmedatafilename"], "w") as f:
|
||||
json.dump(settings["readmedata"], f)
|
||||
|
||||
def moveHostsFileIntoPlace(finalFile):
|
||||
if os.name == 'posix':
|
||||
if os.name == "posix":
|
||||
dnsCacheFound = False
|
||||
print ("Moving the file requires administrative privileges. " +
|
||||
"You might need to enter your password.")
|
||||
if subprocess.call(["/usr/bin/sudo", "cp", os.path.abspath(finalFile.name), "/etc/hosts"]):
|
||||
printFailure("Moving the file failed.")
|
||||
print ("Flushing the DNS Cache to utilize new hosts file...")
|
||||
if platform.system() == 'Darwin':
|
||||
if platform.system() == "Darwin":
|
||||
dnsCacheFound = True
|
||||
if subprocess.call(["/usr/bin/sudo", "killall", "-HUP", "mDNSResponder"]):
|
||||
printFailure("Flushing the DNS Cache failed.")
|
||||
else:
|
||||
if os.path.isfile("/etc/rc.d/init.d/nscd"):
|
||||
dnsCacheFound = True
|
||||
if subprocess.call(["/usr/bin/sudo", "/etc/rc.d/init.d/nscd", "restart"]):
|
||||
printFailure("Flushing the DNS Cache failed.")
|
||||
else:
|
||||
printSuccess("Flushing DNS by restarting nscd succeeded")
|
||||
if os.path.isfile("/usr/lib/systemd/system/NetworkManager.service"):
|
||||
dnsCacheFound = True
|
||||
if subprocess.call(["/usr/bin/sudo", "/usr/bin/systemctl", "restart", "NetworkManager.service"]):
|
||||
printFailure("Flushing the DNS Cache failed.")
|
||||
else:
|
||||
printSuccess("Flushing DNS by restarting NetworkManager succeeded")
|
||||
if os.path.isfile("/usr/lib/systemd/system/wicd.service"):
|
||||
dnsCacheFound = True
|
||||
if subprocess.call(["/usr/bin/sudo", "/usr/bin/systemctl", "restart", "wicd.service"]):
|
||||
printFailure("Flushing the DNS Cache failed.")
|
||||
elif os.name == 'nt':
|
||||
else:
|
||||
printSuccess("Flushing DNS by restarting wicd succeeded")
|
||||
if os.path.isfile("/usr/lib/systemd/system/dnsmasq.service"):
|
||||
dnsCacheFound = True
|
||||
if subprocess.call(["/usr/bin/sudo", "/usr/bin/systemctl", "restart", "dnsmasq.service"]):
|
||||
printFailure("Flushing the DNS Cache failed.")
|
||||
else:
|
||||
printSuccess("Flushing DNS by restarting dnsmasq succeeded")
|
||||
if os.path.isfile("/usr/lib/systemd/system/networking.service"):
|
||||
dnsCacheFound = True
|
||||
if subprocess.call(["/usr/bin/sudo", "/usr/bin/systemctl", "restart", "networking.service"]):
|
||||
printFailure("Flushing the DNS Cache failed.")
|
||||
else:
|
||||
printSuccess("Flushing DNS by restarting networking.service succeeded")
|
||||
if not dnsCacheFound:
|
||||
printFailure("Unable to determine DNS management tool.")
|
||||
elif os.name == "nt":
|
||||
print ("Automatically moving the hosts file in place is not yet supported.")
|
||||
print ("Please move the generated file to %SystemRoot%\system32\drivers\etc\hosts")
|
||||
|
||||
def removeOldHostsFile(): # hotfix since merging with an already existing hosts file leads to artefacts and duplicates
|
||||
oldFilePath = os.path.join(BASEDIR_PATH, 'hosts')
|
||||
open(oldFilePath, 'a').close() # create if already removed, so remove wont raise an error
|
||||
backupFilePath = os.path.join(BASEDIR_PATH, 'hosts-{0}'.format(time.strftime("%Y-%m-%d-%H-%M-%S")))
|
||||
shutil.copy(oldFilePath, backupFilePath) # make a backup copy, marking the date in which the list was updated
|
||||
oldFilePath = os.path.join(BASEDIR_PATH, "hosts")
|
||||
open(oldFilePath, "a").close() # create if already removed, so remove wont raise an error
|
||||
|
||||
if settings["backup"]:
|
||||
backupFilePath = os.path.join(BASEDIR_PATH, "hosts-{}".format(time.strftime("%Y-%m-%d-%H-%M-%S")))
|
||||
shutil.copy(oldFilePath, backupFilePath) # make a backup copy, marking the date in which the list was updated
|
||||
|
||||
os.remove(oldFilePath)
|
||||
open(oldFilePath, 'a').close() # create new empty hostsfile
|
||||
open(oldFilePath, "a").close() # create new empty hostsfile
|
||||
|
||||
# End File Logic
|
||||
|
||||
@@ -430,31 +480,28 @@ def query_yes_no(question, default = "yes"):
|
||||
"""
|
||||
valid = {"yes":"yes", "y":"yes", "ye":"yes",
|
||||
"no":"no", "n":"no"}
|
||||
if default is None:
|
||||
prompt = " [y/n] "
|
||||
elif default == "yes":
|
||||
prompt = " [Y/n] "
|
||||
elif default == "no":
|
||||
prompt = " [y/N] "
|
||||
else:
|
||||
prompt = {None: " [y/n] ",
|
||||
"yes": " [Y/n] ",
|
||||
"no": " [y/N] "}.get(default, None)
|
||||
if not prompt:
|
||||
raise ValueError("invalid default answer: '%s'" % default)
|
||||
|
||||
while 1:
|
||||
sys.stdout.write(colorize(question, colors.PROMPT) + prompt)
|
||||
# Changed to be cross-python
|
||||
choice = myInput().lower()
|
||||
if default is not None and choice == '':
|
||||
choice = raw_input().lower()
|
||||
if default and not choice:
|
||||
return default
|
||||
elif choice in valid.keys():
|
||||
elif choice in valid:
|
||||
return valid[choice]
|
||||
else:
|
||||
printFailure("Please respond with 'yes' or 'no' "\
|
||||
"(or 'y' or 'n').\n")
|
||||
printFailure(
|
||||
"Please respond with 'yes' or 'no' (or 'y' or 'n').\n")
|
||||
## end of http://code.activestate.com/recipes/577058/ }}}
|
||||
|
||||
def isValidDomainFormat(domain):
|
||||
if domain == '':
|
||||
print ("You didn\'t enter a domain. Try again.")
|
||||
if domain == "":
|
||||
print ("You didn't enter a domain. Try again.")
|
||||
return False
|
||||
domainRegex = re.compile("www\d{0,3}[.]|https?")
|
||||
if domainRegex.match(domain):
|
||||
@@ -466,10 +513,10 @@ def isValidDomainFormat(domain):
|
||||
|
||||
# Colors
|
||||
class colors:
|
||||
PROMPT = '\033[94m'
|
||||
SUCCESS = '\033[92m'
|
||||
FAIL = '\033[91m'
|
||||
ENDC = '\033[0m'
|
||||
PROMPT = "\033[94m"
|
||||
SUCCESS = "\033[92m"
|
||||
FAIL = "\033[91m"
|
||||
ENDC = "\033[0m"
|
||||
|
||||
def colorize(text, color):
|
||||
return color + text + colors.ENDC
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Script by Steven Black
|
||||
# https://github.com/StevenBlack
|
||||
#
|
||||
# This Python script will update the readme files in this repo.
|
||||
#
|
||||
# pylint: disable=invalid-name
|
||||
# pylint: disable=bad-whitespace
|
||||
|
||||
import os
|
||||
import platform
|
||||
import string
|
||||
import sys
|
||||
import time
|
||||
import json
|
||||
from string import Template
|
||||
|
||||
# Project Settings
|
||||
BASEDIR_PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
README_TEMPLATE = os.path.join(BASEDIR_PATH, 'readme_template.md')
|
||||
README_FILENAME = 'readme.md'
|
||||
README_DATA_FILENAME = "readmeData.json"
|
||||
|
||||
# Detecting Python 3 for version-dependent implementations
|
||||
Python3 = sys.version_info >= (3,0)
|
||||
|
||||
def main():
|
||||
|
||||
s = Template('${description} | [Readme](https://github.com/StevenBlack/hosts/blob/master/${location}readme.md) | [link](https://raw.githubusercontent.com/StevenBlack/hosts/master/${location}hosts) | ${fmtentries}')
|
||||
|
||||
with open(README_DATA_FILENAME, 'r') as f:
|
||||
data = json.load(f)
|
||||
|
||||
if Python3:
|
||||
keys = list(data.keys())
|
||||
else:
|
||||
keys = data.keys()
|
||||
|
||||
keys.sort(key=cmp_keys)
|
||||
|
||||
tocRows = ""
|
||||
for key in keys:
|
||||
data[key]["fmtentries"] = "{:,}".format(data[key]["entries"])
|
||||
if key == "base":
|
||||
data[key]["description"] = 'Unified hosts = **(adware + malware)**'
|
||||
else:
|
||||
data[key]["description"] = 'Unified hosts **+ ' + key.replace( "-", " + ") + '**'
|
||||
|
||||
tocRows += s.substitute(data[key]) + "\n"
|
||||
|
||||
|
||||
for key in keys:
|
||||
extensions = key.replace( "-", ", ")
|
||||
extensionsStr = "* Extensions: **" + extensions + "**."
|
||||
extensionsHeader = "with "+ extensions + " extensions"
|
||||
|
||||
with open(os.path.join(data[key]["location"],README_FILENAME), "wt") as out:
|
||||
for line in open(README_TEMPLATE):
|
||||
line = line.replace( '@GEN_DATE@', time.strftime("%B %d %Y", time.gmtime()))
|
||||
line = line.replace( '@EXTENSIONS@', extensionsStr )
|
||||
line = line.replace( '@EXTENSIONS_HEADER@', extensionsHeader )
|
||||
line = line.replace( '@NUM_ENTRIES@', "{:,}".format(data[key]["entries"]))
|
||||
line = line.replace( '@SUBFOLDER@',os.path.join(data[key]["location"], ''))
|
||||
line = line.replace( '@TOCROWS@', tocRows )
|
||||
out.write( line )
|
||||
|
||||
def cmp_keys(item):
|
||||
return item.count('-'), item
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user