https://github.com/gdsoumya/dns_hole
DNS Hole is a network-level advertisement and Internet tracker blocking tool which acts as a DNS sinkhole.
https://github.com/gdsoumya/dns_hole
dns-hole dns-sinkhole privacy privacy-enhancing-technologies python
Last synced: 8 months ago
JSON representation
DNS Hole is a network-level advertisement and Internet tracker blocking tool which acts as a DNS sinkhole.
- Host: GitHub
- URL: https://github.com/gdsoumya/dns_hole
- Owner: gdsoumya
- License: mit
- Created: 2019-10-01T17:17:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-10T06:14:06.000Z (over 6 years ago)
- Last Synced: 2025-04-13T15:04:54.381Z (about 1 year ago)
- Topics: dns-hole, dns-sinkhole, privacy, privacy-enhancing-technologies, python
- Language: Python
- Homepage:
- Size: 1.27 MB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DNS Hole
[](https://opensource.org/licenses/MIT)
DNS Hole is a network-level advertisement and Internet tracker blocking tool which acts as a DNS sinkhole. It comes with a tracker and advertisement block list that can be customized according to user preferences and requirements.

## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
**DNS Hole** requires [ **Python (> Python 3.6)**](https://www.python.org/) .
### Getting the project.
```sh
$ git clone https://github.com/gdsoumya/dns_hole.git
or
Download and extract the Zip-File
```
### Installing Dependencies
The Project has a few dependencies which can be installed by running.
```sh
$ pip install -r dependencies.txt
```
## Starting DNS Hole
To start blocking ads and trackers run
```sh
$ python dns_hole.py
```
### Options
- **Aggressive Mode** : Aggressively blocks any link which contains the keyword "AD". Use with **CAUTION**, links like **googleadservices.com** as well as links like **addition.com** will be blocked.
Finally a DNS Server will be initialized at **0.0.0.0:53** for use.
### Errors
Possible Errors :
1. **Run As Root** : On linux based systems the script needs to be executed as root, on windows admin permissions will be requested.
2. **Port 53 is already in use/Socket Error** : Other processes or services are using the required port(53), kill or close them before executing the script.
## Using DNS Hole
To use DNS Hole you can choose one of the following options:
1. Setup DNS Hole on the Hotspot/Router.
2. Set the DNS address in your router settings to point to the DNS Hole system.
3. Setup network settings on specific devices to point their dns to the DNS Hole system.
## Changing Block List
To change/update the block list just add or remove the necessary urls in the BlockList.txt file.
## Working Demo

## Packages Used
- **[dnslib](https://pypi.org/project/dnslib/)** : A library to encode/decode DNS wire-format packets.
## Author
- **Soumya Ghosh Dastidar**
## Contributting
Any contribution/suggestions are welcomed.