Skip to main content

Anti-malware, ad-blocking, and tracking protection tool that populates and manages the Hosts file.

Project description

codecov PyTest

HostsMate

Welcome to HostsMate! A CLI tool for Unix-like operating systems that works with /etc/hosts file.

Protect yourself from malware, tracking, ads, and spam. HostsMate blocks over 1.2M domains from regularly updated sources to keep your system safe. Customize blacklist and whitelist sources, manually block or whitelist domains, suspend HostsMate if necessary.

Installation

To install hostsmate, you can use pip. Make sure to run the installation command with sudo to be able to further run hostsmate with sudo, which is required.

sudo pip install hostsmate

To run tests as well, install hostsmate with dev dependencies:

sudo pip install hostsmate[dev]

How to use

Always use sudo when running hostsmate to ensure that it has the necessary permissions to modify your system's hosts file.

Start hostsmate with sudo hostsmate --run.

sudo hostsmate or sudo hostsmate -h will show the help message:

usage: hostsmate [-h] [-R | -a | -s | -r | -b [backup-path] | -x [domain] |
 -w [domain] | -W [url] | -B [url] | -i [url] | -o [url]]

options:
  -h, --help            show this help message and exit
  -R, --run             parse domains from blacklist sources and start the HostsMate
  -a, --autorun         setup automatic update of your Hosts file (Linux and FreeBSD only)
  -s, --suspend         suspend HostsMate
  -r, --resume          resume HostsMate.
  -b [backup-dir], --backup [backup-dir]
                        create a backup of the existing Hosts file in the specific directory
  -x [domain], --blacklist-domain [domain]
                        blacklist specified domain
  -w [domain], --whitelist-domain [domain]
                        whitelist specified domain
  -W [url], --add-whitelist-source [url]
                        add URL with whitelisted domains to whitelist sources
  -B [url], --add-blacklist-source [url]
                        add URL with blacklisted domains to blakclist sources
  -i [url], --remove-whitelist-source [url]
                        remove URL with whitelisted domains from whitelist sources
  -o [url], --remove-blacklist-source [url]
                        remove URL with blacklisted domains from blacklist sources

Usage details

  • --blacklist-domain option saves the specified domain to user's custom domains section of the Hosts file. These domain names will be preserved when the Hosts file is updated.

  • Using --add-blacklist-source and --add-whitelist-source options you can add URL containing a list of domains, it will be parsed, formatted, deduplicated and used in your Hosts file.

  • While running --suspend option you need to manually enable it back with --resume.

  • --autorun is implemented through anacrontab dependency which is available on Linux and FreeBSD, hence this feature is limited to these OS.
    Autorun frequency may be set to daily, weekly or monthly. Daily is recommended ;)

  • All sources are being parsed concurrently, so it's faster than a lot of similar tools.

Logs

A log file is created for every date hostsmate ran in /var/log/hostsmate directory.

License

This project is licensed under the terms of the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hostsmate-1.0.2.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hostsmate-1.0.2-py3-none-any.whl (36.9 kB view details)

Uploaded Python 3

File details

Details for the file hostsmate-1.0.2.tar.gz.

File metadata

  • Download URL: hostsmate-1.0.2.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for hostsmate-1.0.2.tar.gz
Algorithm Hash digest
SHA256 0f25fcf0287e5c4977bea2d513ad25ba436d9171510936edb54b1e51da95427c
MD5 4bc3626305794d0709d4bfa6a4a02db4
BLAKE2b-256 59c35561276d771d4d7d0a1dbf8702510d99a399a2231f777a3919269fdaf74e

See more details on using hashes here.

File details

Details for the file hostsmate-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: hostsmate-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 36.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for hostsmate-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb3c20ee9e50d8ae3dd7d4211e5b53bf753a5fc1c6615a054647eedf36c64793
MD5 4b3ed2496b549ffe6a7c357b1be24d99
BLAKE2b-256 10d91f1ecef44ea9a4b86dabbb9e9f26820e4105b7df46e9fe83134affd25b81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page