All Projects → ndfred → unifi-pi-hole

ndfred / unifi-pi-hole

Licence: other
A Pi-hole equivalent for the Unifi Security Gateway

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to unifi-pi-hole

PiHole
This contains an ever-growing list of domains to be blocked using the Pi-Hole ad-blocker.
Stars: ✭ 56 (+86.67%)
Mutual labels:  pi-hole, ad-blocker
CyberSecurity-Box
Firewall-System based on OpenWRT or Pi-Hole with UnBound, TOR, optional Privoxy, opt. ntopng and opt. Configuration of the AVM FRITZ!Box with Presets for Security and Port-List. Please visit:
Stars: ✭ 20 (-33.33%)
Mutual labels:  pi-hole, ad-blocker
Docker Pi Hole
Pi-hole in a docker container
Stars: ✭ 4,288 (+14193.33%)
Mutual labels:  pi-hole, ad-blocker
Whitelist
A simple tool to add commonly white listed domains to your Pi-Hole setup.
Stars: ✭ 3,033 (+10010%)
Mutual labels:  pi-hole, ad-blocker
Pi Hole
A black hole for Internet advertisements
Stars: ✭ 34,076 (+113486.67%)
Mutual labels:  pi-hole, ad-blocker
Pi.alert
WIFI / LAN intruder detector. Check the devices connected and alert you with unknown devices. It also warns of the disconnection of "always connected" devices
Stars: ✭ 209 (+596.67%)
Mutual labels:  pi-hole
infrastructure
Flux based GitOps repository for my home lab infrastructure.
Stars: ✭ 14 (-53.33%)
Mutual labels:  unifi
Pi Hole Monitoring
Monitoring Pi-Hole statistics with Grafana
Stars: ✭ 196 (+553.33%)
Mutual labels:  pi-hole
porn-domains
A collection of domains used for explicit adult content like porn websites.
Stars: ✭ 97 (+223.33%)
Mutual labels:  pi-hole
Pihole Kubernetes
PiHole on kubernetes
Stars: ✭ 180 (+500%)
Mutual labels:  pi-hole
homebridge-unifi-occupancy-sensor
An occupancy sensor for Homebridge and UniFi
Stars: ✭ 71 (+136.67%)
Mutual labels:  unifi
mifitxiaomipiholelist
MiFit/Xiaomi PiHole Bock List
Stars: ✭ 28 (-6.67%)
Mutual labels:  pi-hole
Night Pihole
🌙 A Dark theme for your Pi-hole Dashboard.
Stars: ✭ 64 (+113.33%)
Mutual labels:  pi-hole
Pibar
PiBar for Pi-hole - Manage your Pi-hole(s) from your menu bar!
Stars: ✭ 208 (+593.33%)
Mutual labels:  pi-hole
ansible-roles
Here are some Ansible roles I have built for my own use.
Stars: ✭ 48 (+60%)
Mutual labels:  unifi
Blockpage
A temporary unblock solution and blockpage for your Pi-Hole system
Stars: ✭ 191 (+536.67%)
Mutual labels:  pi-hole
pihole-facebook
Facebook DNS Blocklist for Pihole
Stars: ✭ 96 (+220%)
Mutual labels:  pi-hole
Anti Ad
致力于成为中文区命中率最高的广告过滤列表,实现精确的广告屏蔽和隐私保护。anti-AD现已支持AdGuardHome,dnsmasq, Surge,Pi-Hole,smartdns等网络组件。完全兼容常见的广告过滤工具所支持的各种广告过滤列表格式
Stars: ✭ 3,788 (+12526.67%)
Mutual labels:  pi-hole
Pihole adlist tool
An tool to analyse how your pihole adlists cover you browsing behavior
Stars: ✭ 222 (+640%)
Mutual labels:  pi-hole
Filterlist-for-AdGuard-or-PiHole
A very aggressive filter-list that consolidates over 370 lists for use in AdGuard Home, Pi-Hole or similar.
Stars: ✭ 349 (+1063.33%)
Mutual labels:  pi-hole

Unifi Pi-hole

Get the Pi-hole project working on my Unifi Security Gateway. Inspired by the blacklist project.

Installing

SSH into your USG and run these commands:

configure
delete service dns forwarding blacklist
set service dns forwarding blacklist dns-redirect-ip 0.0.0.0

edit service dns forwarding blacklist domains source unifi-pi-hole
set url https://github.com/ndfred/unifi-pi-hole/releases/download/v0.1.0/domains.txt
set description "Consolidated domains list from https://github.com/ndfred/unifi-pi-hole"
set prefix 0.0.0.0
top

edit service dns forwarding blacklist hosts source unifi-pi-hole
set url https://github.com/ndfred/unifi-pi-hole/releases/download/v0.1.0/hosts.txt
set description "Consolidated hosts list from https://github.com/ndfred/unifi-pi-hole"
set prefix 0.0.0.0
top

commit; save; exit

I have yet to work on refreshing the list automatically, but this should get you started.

Building the hosts list

Clone the repo and run the build_rules.py script to download and parse the rules files, and generate the hosts.txt and domains.txt files:

$ python build_rules.py
Parsing https://hosts-file.net/grm.txt
Parsing https://reddestdream.github.io/Projects/MinimalHosts/etc/MinimalHostsBlocker/minimalhosts
Parsing https://raw.githubusercontent.com/StevenBlack/hosts/master/data/KADhosts/hosts
[...]
Parsing https://zerodot1.gitlab.io/CoinBlockerLists/hosts
Wrote 735586 host names in hosts.txt and domains.txt

You can then publish the files on a web server or copy them directly to your Unifi Security Gateway.

The lists come from the Firebog website, which backs the Pi-hole setup script, and aggregates all the safe lists. I might support more advances lists with whitelisting in the future.

Testing Build Status

Just run the test script:

$ python test_build_rules.py 
...........
----------------------------------------------------------------------
Ran 11 tests in 0.186s

OK

Configuration reference

I SSH-ed into my USG, put myself in configuration mode, and queried completion suggestions to get to the documentation:

# set service dns forwarding blacklist
Possible completions:
  disabled	Option to disable blacklisting
  dns-redirect-ip
  		Global redirect IP address for hosts and domains (zones)
  domains	Configure DNS forwarding blacklist DOMAINS
  exclude	domains to GLOBALLY EXCLUDE from DNS forwarding domains and hosts blacklist
  hosts		Configure DNS forwarding blacklist hosts (must be fully qualified domain names)

# set service dns forwarding blacklist domains 
Possible completions:
  dns-redirect-ip
  		Blackhole IP address for domains
  exclude	Domains to EXCLUDE from DNS forwarding blacklist
  include	Domains to INCLUDE in the DNS forwarding blacklist
  source	Blacklisted domains source name

# set service dns forwarding blacklist hosts
Possible completions:
  dns-redirect-ip
  		Blackhole IP address for hosts - overrides global blackhole IP
  exclude	Hosts to EXCLUDE from DNS forwarding blacklist
  include	Hosts to INCLUDE in the DNS forwarding blacklist
  source	Blacklisted hosts source name

# set service dns forwarding blacklist domains source unifi-pi-hole
Possible completions:
  description	Blacklist domain source description
  dns-redirect-ip
  		Blackhole IP address for a domain source - overrides global blackhole IP
  file		A path and filename that provides a list of domains to blacklist, e.g. /config/user-data/hacked_domains.txt
  prefix	Prefix string must include all text before the domain name
  url		A blacklist source url that provides a list of domain names to block

# set service dns forwarding blacklist exclude
Possible completions:
  <text>	domains to GLOBALLY EXCLUDE from DNS forwarding domains and hosts blacklist
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].