Adblock DNS Server
Adblocking DNS server using bind and nginx services. The services are run inside docker containers.
This project is created to help block Ads, at the DNS resolution level. Using this project, you can quickly bring up a caching DNS server that also redirects Ads to a null webserver. If you use this DNS server on your devices/wifi-router instead of your ISP's or other regular DNS servers (Google, OpenDNS), Ads wil be blocked.
To run this project, make sure your system/server has the following packages installed:
Running the server
Follow these steps to get this project up and running.
clone this project. Then, cd into the cloned project folder.
git clone https://github.com/ragibkl/adblock-dns-server.git cd adblock-dns-server
copy the sample
.envfile, and edit the values according to your server settings
cp sample.env .env nano .env
If you are running this locally on your computer, you can leave the default values as is. This will redirect all ads traffic to your computer, and they will return empty.
If you are running this on a local network, or a public server, you should place the ipv4/ipv6 addresses of your server. This will redirect all ads to your server, with empty result.
# .env file - running locally FQDN=dns.localhost.localdomain # optional: fdqn of your server IPV4=127.0.0.1 # ipv4 address of your server IPv6=::1 # ipv6 address of your server
run the start script to start the dns server
do a quick test
# tests dns lookup against Google's dns server # should return regular/valid response $ nslookup zedo.com 220.127.116.11 Server: 18.104.22.168 Address: 22.214.171.124#53 Non-authoritative answer: Name: zedo.com Address: 126.96.36.199 # tests dns lookup against our adblock dns server # should return our server's IP instead $ nslookup zedo.com X.X.X.X Server: X.X.X.X Address: X.X.X.X#53 Non-authoritative answer: Name: zedo.com Address: X.X.X.X
stopping the dns server
Configuring your device
Option 1: WiFi Router level
- Affects all devices connected to said router.
- Go to your router admin page, under WAN settings.
- Edit DNS settings. Use your adblock-dns server's IP address instead of Automatic or Google's (188.8.131.52, 184.108.40.206)
Option 2: Personal Computer level
- Affects single device.
- Go to your computer's network setting.
- Change DNS settings. Use your adblock-dns server's IP address instead of Automatic or Google's (220.127.116.11, 18.104.22.168)
This project could use some improvements and help in many areas, which includes, documentation, testing, code improvement, and deployment implementations.
If you have any suggestions, or would like to report and problem, create a Github issue to grab my attention.