- Perl 75.3%
- Shell 24.7%
| allowlists | ||
| dev-t | ||
| dnsmasq.d | ||
| lists | ||
| repos | ||
| repos-noupdates | ||
| util | ||
| .editorconfig | ||
| .gitignore | ||
| .gitmodules | ||
| CHANGELOG.md | ||
| CONTRIBUTING.md | ||
| custom.list | ||
| LICENSE-commons-clause.md | ||
| LICENSE.md | ||
| local.list | ||
| make-block.pl | ||
| README.md | ||
| update.cfg.example | ||
| update.sh | ||
You Don't Need Pi-hole
Network-wide DNS blocking without extra hardware.
This project implements the ad-blocking functionality of a Pi-hole without needing any extra hardware. All you need is a Linux computer on your network. This might also work with a Mac OSX computer, but I haven't tested it.
A Pi-hole is a Raspberry Pi based "black hole" for Internet advertisements. It works by intercepting and answering DNS queries for a list of known advertisement servers.
This project instead uses dnsmasq running on an existing server to answer DNS
queries.
How to Install
You'll need dnsmasq installed for this.
- Clone the project:
git clone --recursive https://codeberg.org/h3xx/you-dont-need-pihole.git /etc/you-dont-need-pihole
- Run
update.shto generate the initial blocklist:
/etc/you-dont-need-pihole/update.sh
Important
If you didn't use
/etc/you-dont-need-piholeas the installation directory, updatednsmasq.d/01-you-dont-need-pihole.conf, replacing/etc/you-dont-need-piholewith wherever the root of this project is installed to.
- Add You Don't Need Pi Hole's
dnsmasq.dconfiguration directory path todnsmasq.conf:
echo 'conf-dir=/etc/you-dont-need-pihole/dnsmasq.d' >> /etc/dnsmasq.conf
You can also copy or symlink dnsmasq.d/01-you-dont-need-pihole.conf if you need
the config to live somewhere else.
- Restart the
dnsmasqservice:
# Debian & Ubuntu, RedHat & CentOS
service dnsmasq restart
- Make sure
53/udpis unfirewalled:
# Debian & Ubuntu, RedHat & CentOS
sudo firewall-cmd --add-port=53/udp --permanent
-
Go into your router settings and change the DNS IP address provided via your router's DHCP responses to be your server's (i.e. the one with You Don't Need Pi Hole) local IP address. See this thread for a walkthrough.
-
Recommended: If you use the You Don't Need Pi Hole machine as a general computer, configure it to use the local
dnsmasqdaemon for client DNS queries. This is a good idea because it may save some network traffic depending on how your router works. Worst case scenario, it'll do nothing.
If your OS uses dhcpcd for network configuration (Slackware), you can add
this line to your /etc/dhcpcd.conf:
static domain_name_servers=127.0.0.1
License
Copyright (C) 2021-2022 Dan Church.
License GPLv3: GNU GPL version 3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
with Commons Clause 1.0 (https://commonsclause.com/).
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
You may NOT use this software for commercial purposes.