TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ad blocking with Raspberry Pi and Pi-hole

241 点作者 christian_fei大约 5 年前

29 条评论

strenholme大约 5 年前
I actually have been doing some work with MaraDNS to have the ability to have a pi-hole sized blacklist. The main source of pi-hole’s blacklist is this Git repo:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;StevenBlack&#x2F;hosts" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;StevenBlack&#x2F;hosts</a><p>That is about 60,000 hosts, so I added MaraDNS support to have up to 500,000 blacklisted names. Since it’s a speed-optimized (not size-optimized) cache, each element takes about a kilobyte of memory, so a blacklist this size takes about 60 megabytes of memory for MaraDNS to store (on a modern Core i7 7600U processor, it only takes about two seconds to load all 60,000 elements in to memory), but it’s very rapid to use.<p>The script to take that blacklist and convert it in to a MaraDNS compatible format is here:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;samboy&#x2F;MaraDNS&#x2F;blob&#x2F;master&#x2F;deadwood-github&#x2F;tools&#x2F;make.blacklist.sh" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;samboy&#x2F;MaraDNS&#x2F;blob&#x2F;master&#x2F;deadwood-githu...</a><p>There are ways to make the memory footprint of the blacklist smaller, but this was a quick and simple way to implement a medium sized blacklist. Finding ways to have, say, 10 million blacklist elements with a small memory footprint is left as an exercise for the reader.<p>My current project is to make a proper Docker container for MaraDNS.
评论 #23076333 未加载
评论 #23074308 未加载
评论 #23078139 未加载
Blackadderz大约 5 年前
Pi-hole has been excellent. I was able to discover that my Samsung TV was reporting minute by minute updates on what I was watching to a local Australian company.<p>Unplugged it faster than I could swear.
评论 #23076785 未加载
评论 #23076077 未加载
评论 #23075395 未加载
评论 #23077694 未加载
评论 #23075668 未加载
评论 #23076676 未加载
评论 #23078193 未加载
Sohcahtoa82大约 5 年前
For my home desktop browser, I just use uBlock Origin to block ads.<p>But for my phone, I set up a PiHole running on an EC2 instance and VPN into it from my phone. Blocks ads in everything, not just my web browser. The VPN is configured to only tunnel DNS lookups, not traffic, so the EC2 bandwidth bill is minimal.
评论 #23074697 未加载
评论 #23075782 未加载
评论 #23074723 未加载
评论 #23075015 未加载
评论 #23074314 未加载
LeoPanthera大约 5 年前
The move of applications such as Firefox to start using DNS-over-https to hardcoded DNS servers will render such user-modified DNS services useless.<p>Firefox can have this feature disabled, but more malicious applications will simply not give you the choice.
评论 #23076489 未加载
评论 #23076658 未加载
评论 #23078096 未加载
评论 #23076639 未加载
jedberg大约 5 年前
Is anyone successfully using PiHole with non-technical users?<p>My main concern with putting PiHole on my home network is that for example my mother in law might not understand that she can&#x27;t get to some web page because it&#x27;s being ad-blocked, nor would she be able to go to the web admin page and temporarily unblock it.<p>Even as a technical person sometimes it takes a while to figure out that a page isn&#x27;t working because of adblock or pi-hole.<p>How do people deal with this?
评论 #23074582 未加载
评论 #23074319 未加载
评论 #23074449 未加载
评论 #23074696 未加载
评论 #23074321 未加载
评论 #23077018 未加载
评论 #23077157 未加载
ananonymoususer大约 5 年前
Pi-Hole is a great project, and it&#x27;s not limited to running on a Raspberry Pi either. I&#x27;ve got it running as a (x86-64 Ubuntu) VM in the same hypervisor that hosts my firewall. It&#x27;s lightweight, super responsive, and provides great statistics on what it is doing.
greencar大约 5 年前
&gt; Use it for ad-blocking in your home network and to finally browse the web, watch videos etc. without annoying ads.<p>It doesn&#x27;t really do this as well as a browser adblocker, YouTube ads for example can&#x27;t effectively be blocked with pihole
评论 #23074599 未加载
评论 #23073891 未加载
评论 #23076404 未加载
评论 #23074248 未加载
评论 #23078965 未加载
gurrone大约 5 年前
I find it amazing how often ad blocking is discussed here, and start to wonder how many peeps hanging out here on the other hand depend indirectly on ad revenue to pay bills? There are obviously the big corps Facebook and Google, but also my own small employer, which is in theory in a different biz, runs ads on the web shop as an additional income source (which I find not very clever, increases page load times and is simply not our core biz). Do we all pay our bills with money made from the pour souls who did not get around to install an ad blocker or advanced setups like a pi hole? I&#x27;m on the pro ad blocking camp personally, also worked in the past in a biz that was 100% ad financed for a short period of time. Also there the whole tech department was using ad blockers.
评论 #23078735 未加载
评论 #23078821 未加载
评论 #23078197 未加载
strangelove026大约 5 年前
This is a great repo. Step by step easy configuration of a pihole on a gcp compute instance with openvpn. I had pihole running on my phone blocking ads in the NYTs app!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;rajannpatel&#x2F;Pi-Hole-PiVPN-on-Google-Compute-Engine-Free-Tier-with-Full-Tunnel-and-Split-Tunnel-OpenVPN-Configs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rajannpatel&#x2F;Pi-Hole-PiVPN-on-Google-Compu...</a>
m3at大约 5 年前
The combination of pihole and raspberry pi has impressed me. I just checked and the last reboot of my pi was 180 days ago, and since then things have just worked.<p>It&#x27;s in stark contrast with my server, which admittedly has more demanding tasks. For $35 it&#x27;s the most trustable computer I bought, I now have a lot of respect for the Pi foundation.
评论 #23075680 未加载
brenden2大约 5 年前
I use pi-hole, and it&#x27;s great, but for browsers you still need something like uBlock Origin installed to properly block ads. The thing I like about pi-hole is it also blocks a long list of trackers that are bundled by various mobile SDKs. There&#x27;s no way to block those with iOS or Android, except at the network level.
评论 #23074467 未加载
oschvr大约 5 年前
Funny, I did the exact same thing 1 week ago<p><a href="https:&#x2F;&#x2F;oschvr.com&#x2F;posts&#x2F;blocking-ads-with-pihole&#x2F;" rel="nofollow">https:&#x2F;&#x2F;oschvr.com&#x2F;posts&#x2F;blocking-ads-with-pihole&#x2F;</a>
评论 #23074763 未加载
dastx大约 5 年前
Another alternative is AdGuard Home. They&#x27;ve come a long way since they announced it. I switched to AdGuard Home some 6 months ago and it has been great.
评论 #23074615 未加载
lordnacho大约 5 年前
I&#x27;m looking for a way to combine the adblocking with a VPN switcher that takes eg NordVPN and routes all my home traffic through a variety of tunnels (they provide a load of openVPN files). Is there a ready-made way to do this? The idea is for anyone in the house to be protected by both the adblock and the VPN.
评论 #23073829 未加载
评论 #23074448 未加载
m45t3r大约 5 年前
Thanks for the article to remember me of the existence of this project. I decided to do a setup in my home network using an old Raspberry Pi 1 that I had. Mainly because the router of my ISP screwed up really hard in its DHCP server, so I decided to disable it and use Pi-hole&#x27;s one instead.<p>I tried to make this setup as robust as possible, using OverlayFS [1] so root is read-only unless I remount it (to change configuration or upgrades) and with a watchdog so it can auto-reboot in case my Raspberry Pi is unresponsive. Pretty happy with this setup and it my internet seems more responsible than ever.<p>[1]: <a href="https:&#x2F;&#x2F;yagrebu.net&#x2F;unix&#x2F;rpi-overlay.md&#x2F;wiki&#x2F;Setting_up_overlayFS_on_Raspberry_Pi" rel="nofollow">https:&#x2F;&#x2F;yagrebu.net&#x2F;unix&#x2F;rpi-overlay.md&#x2F;wiki&#x2F;Setting_up_over...</a>
评论 #23077539 未加载
jacques-noris大约 5 年前
I&#x27;m surprised, that no one here has mentioned Eblocker yet. It works a bit like Pi-hole, but is much easier to install and use. Eblocker used to be a commercial product (with its own hardware), but since this didn&#x27;t work out the company open-sourced it a few months ago. It&#x27;s free now, has a good interface and great performance and the former developers are still working on it. You can install it on a raspberry, but also on other SBCs. I&#x27;m in no way affiliated with them, just a happy user. <a href="https:&#x2F;&#x2F;eblocker.org&#x2F;en&#x2F;" rel="nofollow">https:&#x2F;&#x2F;eblocker.org&#x2F;en&#x2F;</a>
bberrry大约 5 年前
I wish it were more effective in removing Youtube ads on my kids&#x27; iPads, but I understand it&#x27;s a tall order. At least it gets rid of ads in most other apps.
评论 #23074431 未加载
评论 #23074369 未加载
评论 #23074256 未加载
评论 #23074128 未加载
评论 #23074774 未加载
评论 #23078946 未加载
doctoboggan大约 5 年前
Does anyone have any good suggestions for blacklists? I&#x27;ve only been using the default and am wondering if I should add some more items to the list.
评论 #23074540 未加载
评论 #23074252 未加载
pharaohgeek大约 5 年前
I set this up a couple of months ago and have been really happy with the results. Ad blockers on our iPhones&#x2F;iPads are fine, but not always completely effective. I can&#x27;t install one on my corporate laptop so there&#x27;s no way around ads there. Using Pi-Hole was a perfect fit. I&#x27;ve only had to whitelist a single site that had problems with it.
delcaran大约 5 年前
I currently use a 3-layered solution: browser blockers -&gt; custom host file on each machine (StevenBlack hosts for linux and windows, nebulo for android) -&gt; nextdns<p>I&#x27;m actually satisfied, but I&#x27;m trying to setup pi-hole+unbound on a cloudatcost host I own to reduce the load on nextdns, so far without success.
评论 #23077370 未加载
accrual大约 5 年前
For OpenBSD users there is unbound-adblock[0]. It&#x27;s a small shell script that uses only in-base utilities and can be run with minimal privileges.<p>[0] <a href="https:&#x2F;&#x2F;www.geoghegan.ca&#x2F;unbound-adblock.html" rel="nofollow">https:&#x2F;&#x2F;www.geoghegan.ca&#x2F;unbound-adblock.html</a>
评论 #23077368 未加载
Havoc大约 5 年前
There are dockerised versions as well if you happen to have a docker stack somewhere in your home
评论 #23074272 未加载
2OEH8eoCRo0大约 5 年前
I already have a home server so I run the pihole container with Podman. Pretty slick. It started as a quick project and then permanently tied up my raspberry pi because the adblocking was so awesome I didn&#x27;t want to shut it down.
NicoJuicy大约 5 年前
I actually use NextDNS now, it&#x27;s been on HN before and got good comments.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22854209" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22854209</a>
评论 #23078653 未加载
IRegretNothing大约 5 年前
I&#x27;ve tested pihole for months now, it&#x27;s working really well.<p>Set up a VPN to an EC2 with pihole on it, no more ads on Spotify. Even family members wanted the VPN config, they really appreciate it.
alecco大约 5 年前
<p><pre><code> curl -sSL https:&#x2F;&#x2F;install.pi-hole.net | bash </code></pre> Sigh
评论 #23079219 未加载
kd913大约 5 年前
Please do note that Android appears to be quite weird in regards to accepting network set DNS.<p>My observations so far have been that Android tends to ignore any DNS set by either the network via DHCP or statically set. Android instead probes the gateway for 8.8.8.8, and happily uses that instead.<p>The only way I have been able to solve this has been to setup a VPN (I prefer wireguard) on the pihole. Android seems to accept this.<p>The above in combination with say a DDNS hostname means that I now have a permanent adblocked VPN on my android phone which isn&#x27;t too bad.
评论 #23074489 未加载
tuananh大约 5 年前
some note for those want to use pihole<p>- in windows, if you use primary dns as pihole and secondary dns as another cloud option (cloudflare, google), some ads will go through. secondary dns is not failover dns. try it and you will see.
评论 #23078213 未加载
adam0c大约 5 年前
I mean this is a great project and all but don&#x27;t most moderns routers already have this built into them and are able to add VPNs.
评论 #23077435 未加载