/hostsfile-blocker

Block hosts with this simple pyhon library

Primary LanguagePython

hostsfile-blocker

Block hosts with this simple pyhon library

Dependencies

Just Python 3

Usage

Execute __main__.py with admin rights. If you do not, you'll be notified to do so.

sudo python3 hostsfile-blocker

or

sudo python3 __main__.py

Note: Windows users, do not have to prefix the exectuion with "sudo".

Change the path to the hostsfile

If your hostsfile is located somewhere else than /etc/hosts, set the path to your hostsfile with the method set_hosts_file.

Windows hosts file

Usually the Windows hosts file is found under C:\Windows\System32\drivers\etc\hosts.

MacOS hosts file

Usually the MacOS hosts file is found under /private/etc/hosts.

Restrictions

Wildcards are not supported by the hostsfile