Skip to content

Ar0xA/USG-DNS-ADBLOCK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 

Repository files navigation

Ubiquiti USG DNS Based adblocker

NOTE: after a firmware upgrade, the script needs to be executed again manually to re-create the crontab job and refill the dnsmasq list.

So after a firmware upgrade, log in using SSH, sudo to root and run /config/user-data/update-adblock-dnsmasq.sh

What does this do

This uses your Ubiquiti Security Gateway device as a DNS blackhole, much like pi-hole does. It automatically, daily, downloads various known and trusted blacklists for advertisement, spyware, malware and tracking networks and makes it so that their DNS address resolves to 0.0.0.0 instead of the actual IP address. The result is that no data is downloaded from, or uploaded to, those networks.

versions

20171203
-added first youtube adblocking
20171121
First release
-added pi-hole domains as suggsted by @recrudesce
-added https://github.com/notracking/hosts-blocklists

How to install

SSH into your USG:

sudo su -
curl -o /config/user-data/update-adblock-dnsmasq.sh https://raw.githubusercontent.com/Ar0xA/USG-DNS-ADBLOCK/master/update-adblock-dnsmasq.sh
chmod +x /config/user-data/update-adblock-dnsmasq.sh
/config/user-data/update-adblock-dnsmasq.sh

Check if all went fine by nslookup on a box that uses your USG as DNS (default from DHCP)
nslookup aa.i-stream.pl (should return address: 0.0.0.0)

crontab -l should show you now a line to automatically update once a day

Originally taken from https://community.ubnt.com/t5/UniFi-Routing-Switching/Use-USG-to-block-sites-apps-like-ER/td-p/1497045

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages