Skip to content

A script to block certain website access from Computer. The scripting is done in Python, and is compatible with Windows and Linux.

Notifications You must be signed in to change notification settings

projjal1/Website-Blocker-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Website-Blocker-Python

A script to block certain website access from Computer. The scripting is done in Python, and is compatible with Windows and Linux.

Description

IT administrators always want to restrict internet access in a work environment to certain URLs. Although they use advance DNS and Directory services to accomplish this, many don't.

Also in a multiwork environment like a cyber-cafe this is very much needed. I have written a Python script to emulate this scenario.

Running the Python script will add redirect entries or loopback entries to dns file against such website URLs specified in block_websites file.

Again I have included a way to block certain websites at particular time interval (called work hour) and not block at certain time(called fun hour). When the script gets out of work hours, it will delete those new entries added to dns config file. Thus enable access.

Motivation or Improvement

The enthusiasts are advised to develop on this. What can be done is we can create an executable that run as a process rather than execution as a script from Command Line.

Instructions

Make necessary changes to block_hours.txt as needed.

Note "work hours" refer to start time of blocking sites, and "free" refers to end of blocking URLs.

The sites that need to be blocked can be added as an entry in seperate lines in block_sites.txt

Dependencies

  • Python 3.5+
  • Windows Host, Linux Host
  • Terminal to execute script from

OS Compatibility

Linux and Windows Host

Execution Instructions

Run the script from directory using command:

python script.py

About

A script to block certain website access from Computer. The scripting is done in Python, and is compatible with Windows and Linux.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages