Pi-hole 5.0
pi-hole.net
pi-hole.net
Depending on how pihole is installed, this may not upgrade it. I personally have it installed with docker and uses watchtower for updates, but the risk with this mechanism is that it can break things.
#!/bin/sh
LOG_FILE=/var/log/update_pihole.log
echo "Starting upate" >> $LOG_FILE
date >> $LOG_FILE
pihole -up >> $LOG_FILE
pihole -g >> $LOG_FILE
exit 0However note that the developers of PiHole do not recommend automated upgrades, or at least be aware of the implications
I’m especially excited to see CNAME inspection. I was tired of trying to figure out what domains like “xuenl4v1szy8g.cloudfront.net” were doing.
Is there a good explainer for CNAME inspection? I'm not finding anything good with my Google Fu.
Let's say I have your own blog running on dastx.me, and I wanted some ads from adgiant.com.
As an adblocker you've added `* .adgiant.com` to your blacklist and I'm an asshole and try to circumvent such adblocking measure. Them young millennials and their tech. Stealing me out of my money!
So I go to adgiant.com and ask them if there is something i can do. adgiant.com asks me to add a new DNS record of `CNAME definitely-not-an-ad-subdomain.dastx.me -> terribleads.adgiant.com`. This way, whenever I wanna call terrible-ads.adgiant.com, I instead use `definitely-not-an-ad-subdomain.dastx.me`.
When it comes to adblocking this is an issue because adblocking lists are usually based on a blacklist. They'll have `*.adgiant.com` on the list but not `definitely-not-an-ad-subdomain.dastx.me`, thus my ads will start working. We could of course ad every subdomain we come across to the blacklist, but suddenly our adblock list doubles, triples, quadruples or more.
What adblocking software do now, is they do a dns lookup for every domain, and consider all domains in the result as the same. So if either of previous domains are in the block list, both domains are considered blocked.
This CNAME method is also a huge security issue, but I'm not gonna go into that.
A security issue for the website with the CNAME, or a security risk for Pi-hole implementing this feature?
I will. The CNAME method could potentially allow a malicious actor to harvest user cookies, gain access to their accounts, and utterly destroy them.
So this means that the ad blocker will query "definitely-not-an-ad-subdomain.dastx.me" and realize that it actually points to "terribleads.adgiant.com", right?
Right
Yeah, uBlock Origin recently added a new permission request just to allow that.
cdn used to mean - serve the same static content all over the world and speed things up.
cdn now means - serve up different content to every single person and track them.
take a look at stack overflow and it's cdn.
Of course this'll add overhead to the visited website manager because the IPs will probably change regularly as they're pointing to cloud services. But I'm sure they'll manage to automate this.
I bet this will be the next step in this cat & mouse game.
What if the ad-network is domain-fronting via a CDN? Either ways, can't block IPs since http-domain <-> IP isn't supposed to be a one-to-one mapping, each belong to different layers of the TCP/IP stak.
Here is an example (the domains are fake, it’s for demonstration purpose only): The domain adcompany.com 5 is in my blacklist, so it returns the IP of my Pi-Hole if I do a DNS query:
$ host adcompany.com adcompany.com has address 192.168.1.10
But if I do a DNS query of ad.newspaper.com it doesn’t get blocked by Pi-Hole even though it’s simply an alias (CNAME) for adcompany.com:
$ host ad.newspaper.com ad.newspaper.com is an alias for adcompany.com. adcompany.com has address 6.6.6.6
What I would like that Pi-hole do is to check if the domain is a CNAME (in the example ad.newspaper.com) then comparing the domain that is aliased to (in the example adcompany.com) with my blacklist. If it is in my blacklist block the domain (by returning the IP of my Pi-hole).
Source: https://discourse.pi-hole.net/t/apply-pi-hole-blocking-to-cn...
I'd encourage anyone to try that out
Pihole is a system wide Adblocker and so is NextDNS on iOS. So are the ones you can install on Android rooted.
Relevant adventure with iOS update rejection: https://adguard.com/en/blog/adguard-pro-is-back.html
Essentially - it's reading user-defined data - which is probably enough to be really bad, incase of a malicious exploit in the wild.
Scenario for attack: Laptop looks up a website, DNS request is made to pi-hole, pi-hole sends request to internet. Response packet received back is actually from an attacker, that uses a known vulnerability in the handling of the packet to take over the machine.
Attacker can now see what DNS requests are being made, and by returning custom responses, it can MITM any HTTP request you make from your laptop. Let's hope everything is encripted via TLS, and hope that some piece of software that just asked for admin permission didn't just install a new TLS trust root.
Ironically, after disabling it for a minute and then loading through the app, it didn't block the video ads (not rendered into the video).
YMMV of course, but it wasn't usable for me since everyone in the household needs to understand/solve any issues.
In any case, I don't see that a smart TV is going to be any better in this respect.
dnsmasq
adblock
luci-app-adblock
You may also need libustream-mbedtls
Just tried it, works great. With a few small lists, the amount of blocked DNS requests is floating at around 30%.[1]: https://openwrt.org/docs/guide-user/services/ad-blocking
Their privacy policy seems legit[0] but why trust them at all when Pi-hole is an option?
though they do also have some additional security protections for typosquatting, safebrowsing, homoglyphs, threat-intelligence which is also nice. All of which could be done on a pihole though not out of the box when I last used it ~2 years ago.
Pricing wise it’s over 2 years worth of service for the price of an original Pi, a good SD card and a case.
The only circumstances where Pi Hole is unquestionably superior is if you are on a network that redirects all DNS requests there are still some ISPs that do that however if you are on such network you probably want to either get off it ASAP or use a VPN.
I've been thinking about running a Pi-hole at home and redirecting all my phone traffic through it via WireGuard.
I also had to manually provision my Android phone on IKEv2 (ipsec), Algo used to provide a strongswan config but unfortunately they dropped this in favour of wireguard. But you can still set it up manually (and on Samsung devices you don't even need strongswan). Wireguard is faster, yes, but my work blocks pretty much every port they don't know, except IKEv2/ipsec because many contractors use it to connect to their work :)
One should always have a spare Pi around.
I run pi-hole on my qnap nas at home since it’s always on anyhow.
Their install script is at https://install.pi-hole.net
Edit: Oops I didn't wipe the container. Works now!
The block list database can be accessed here, you can query a domain to see if they're blocked in Indonesia: https://trustpositif.kominfo.go.id/
If you point me at a checkout page for $2/month to not even have to think about plugging a Pi in, I’m going to pull my credit card out in a heartbeat. A single coffee costs me more. Think about your time!
But it's about taking control too. Personally I wouldn't like taking a service even if it were free, over hosting something myself, especially when it's made as easy as Pi-hole does.
Pi-hole is a tool to improve your privacy. Handing all your DNS requests to a 3rd party is the exact opposite. Now you have to deal with their privacy policy, track whether that company got hacked or bought etc.
Installing and maintaining pi-hole takes very little time.
It's baffling how much useless telemetry and other crap there is, slowing internet down and wasting cpu cycles.
This is more impressive than it sounds. My pihole currently uses about 25MB of RAM with over half a million blocked domains and around 20 clients.
https://www.reddit.com/r/pihole/comments/gathus/pihole_on_ap...
One idea that I want to explore is to create an Alexa Skill to temporarily disable Pi-Hole. This has probably been done already.
Seemed like a great way to handle that problem -- especially for the non-technical people on your network.
pi@pihole:~ $ pihole -up
[i] Checking for updates...
[i] Pi-hole Core: up to date
[i] Web Interface: up to date
[i] FTL: up to date
[] Everything is up to date!
pi@pihole:~ $ pihole -v Pi-hole version is v4.4 (Latest: v5.0)
AdminLTE version is v4.3.3 (Latest: v5.0)
FTL version is v5.0 (Latest: v5.0)Try this pihole checkout master
With AdGuard DNS or uBlock Origin I still get into situations where occasionally they break a site completely and I have to temporarily disable the plugin (or switch to cell tower dns) to get the site working, so I’d want a quick way out of pi-holing traffic as well
https://i.imgur.com/K6VgV2G.png
Note this is from pihole 4.3, but I can't image 5 would remove this feature.
It's a feature that's been around for 2 years or more
Thanks for the tip, I don’t have any home assistants but this would be the first integration I’d set up
I also don't like it as AdGuard is a commercial company, and I have zero need for the added features like parental control.
But I don't really care, I run all the dockers that have nothing to do with home assistant outside of hassio anyway.
For me that means Firefox, uBlock Origin and pihole (though I ran dnsmasq myself for a while, I like what they've made of pihole now, it's come a long way!)
oh, good to know! This concerned has stopped me from going out of way to setup pihole
Bookmark the following URL
http://pi.hole/admin/api.php?disable=120&auth=PWHASH
Replace PWHASH with the value of your WEBPASSWORD in setupVars.conf cat /etc/pihole/setupVars.conf | grep 'WEBPASSWORD=' | cut -c13-
and '120' with the number of seconds you want to disable the Pi-hole filtering for.I've been using pi-hole for 4 years now and I can remember two situations when I had to disable it - and one of those was cloudflare's fault (PS4 cloud saves don't work with 1.1.1.1 DNS)
Not sure what that page holds but you can find out all about Pi-hole here:
Reasoning: appliances like Chromecast/Apple TV/whatever will often ignore DHCP DNS settings if it doesn’t resolve, and they’ll reach out to 8.8.8.8/8.8.4.4 directly.
Websites prove their identity via certificates. Firefox does not trust this site because it uses a certificate that is not valid for pi-hole.net. The certificate is only valid for the following names: *.sucuri.net, sucuri.net
Side note: it was working for me about an hour ago, but not anymore
Now if it could just filter out YouTube ads...
Ive heard that the problem is that the native YT apps come with a big list of IP addresses for the ad servers, instead of doing lookups.
A firewall is a little more than what I would trust to a raspberry pie, though...
At least it is opensource and works great.
They have an open issue [0] since a couple years ago, but so far it is not a feature yet.
For me on top of that, my wife and I often join chromecast together, and she has an iPhone. Vanced is pretty much fully compatible with the official YouTube app.
That would be fine by me, if it wasn't because SAI requires Android 5.0, while my Nvidia Tegra -like tablet (Xiaomi MiPad 1) is stuck on Android 4.4 :-(
(no, Lineage and friends is not a good replacement, they all break the camera, and yet worse, suck battery like crazy)
Although I think it is indeed possible to block youtube ads through DNS filtering, it’s just really difficult & only works temporarily before needing to block new domains.
Empirically, I don't get YouTube ads in the iOS app. I do use Firefox Focus as a content blocker, in addition to AdGuard DNS. I don't use the AdGuard app, and it was my understanding that Firefox Focus only blocked ads in Safari, so I assumed it was AdGuard DNS. The documentation for AdGuard DNS seems to indicate that it shouldn't work for this, but it seems like either that documentation or the documentation for iOS content blockers is missing something. Unless YouTube has just decided not to serve me ads for some reason. (I'm not complaining either way.)
Just pay for YT premium if you don't want ads (to all those people complaining about wanting an option to pay and not be tracked/advertised to/etc - this is a great opporunity to put your money where your mouth is)
Also, make sure to block UDP and TCP on port 53, as well as UDP on port 443 (Chrome snitching).
I know, you can just disable the blocker and try again, but doing so from my phone is not very convenient...
So I switched to AdGuard DNS on my devices.
Just jumped onto it and kicked off a "pihole -up" and off it goes upgrading beautifully.
pihole is a massively underrated project.
[i] Target: https://hosts-file.net/ad_servers.txt
[] Status: Connection Refused
[] List download failed: no cached list available
Looking at the query log, I see a fairly large amount of requests 24/7 by my Xiaomi robot vacuum and my Xiaomi desk LED Desk Lamp. I've blocked both of them.
Is there any way of disabling the wifi on the desk light completely? Right now i've connected the lamp to my Wifi and blocked it at the router to prevent it from starting its own WiFi network.i have a pihone running on a cheap vps on internet, but i connect to it with a vpn and that's draining my smartphone battery. i want to be able to change only the dns settings and point to my pi-hole. but at that time the recommendation was to not run the dns part on the internet because it could be used for dns replay attacks. i found some iptables rules on the net at time but was not sure are they ok. i did not want the ip address blacklisted because i was running some other services on that server.
https://docs.pi-hole.net/guides/vpn/only-dns-via-vpn/
A Wireguard setup would probably be even less resource intensive if you know how to set it up (there’s no official tutorial for Wireguard).
Do not open your pi to the internet, I doubt the iptables rules would be sufficient to protect it.
To run a split wireguard-tunnel to a DNS server, add its IP to the allowed-IPs list: https://www.reddit.com/r/WireGuard/comments/bqccdz/split_tun...
If you're on an Android phone, apps like Blokada (plain old DNS), Nebulo (DoH and DoT), Intra (DoH) can split tunnel traffic to a DNS server of your choice. Note that, Android 9+ supports DoT, out of the box. Look for the Private DNS setting.
Wireguard is working so well, that I am now thinking of starting up additional services for the family to use. Voip/Filestore, pic library etc etc... all firewalled of course.
I also run their DNS53-to-DoH proxy on a small VM and that VM's IP is the first DNS server in the DNS server list included with DHCP leases (with NextDNS's public IPs as the second and third, losing host-level granularity/logging if the VM is down for whatever reason).
If I install it say in a remote server in digital ocean, how can I use my phone/computer to use pi hole?
Still a noob when it comes to networking so any help is appreciated thanks :)
It is a DNS server. Basically whatever you put into DNS Server list on your device (some host on local network, some host with public IP) - your device will send DNS queries to THAT host.
More often than not, you will configure your router to hand out your local devices these DNS servers via DHCP.
So that answers the question: you can host it on local network or use remote server (given you have public IP and can open port 53/UDP). If you don't have firewall there, you will probably be configuring host local firewall to allow using DNS from hosts@home. It may get complicated if you have a dynamic address for your home router.
My setup:
2x Raspberry Pi running Pi-hole 1x OpenWRT running DHCP
DHCP answers with DNS servers rpi1 and rpi2 IP addresses.
Does this make sense?
Good luck guys!
I host pihole on a home server in a docker container and spend 5 mins a month just updating it. No other administration. Definitely use it to get rid of trackers and ads.
(I should add that I also pay for about dozen publications/newspapers that I read frequently in lieu of not seeing ads)
If this is still true, this pi hole update might solve those ads at least?
I'm a little disappointed that they seem to be very uninterested on how to get it working on "unsupported" configurations
My x86 gateway currently runs on Gentoo (PFsense kept having random crashing issues) and it's something I'd love to add to it
as far as I can tell all Pi-Hole needs is
- Lighttpd + PHP (web management portal)
- DNSMASq (DNS)
- DHCPD (DHCP)
- git (blocklist updates?)
There was a single github issue tracker where someone got it working fairly easily (essentially saying "please install package X/Y/Z" during setup) which was closed by the developer as "only two people have asked about Gentoo"
I know Gentoo is fairly niche as far as distributions go, but seeing popular software moving away from "here's how to compile/install it" to "here's a docker container/here's what "we" support" is very disheartening
At its core, all you really need is curl / wget to pull a few text files and then reload dnsmasq.
Sure you’d miss out on the reporting side (which is actually the only reason I switched to pi-hole last year) but it would run on literally any system that runs Linux and dnsmasq.
As for DHCP, I think pi-hole uses dnsmasq for that too. However I’ve wasnt able to get pi-hole to accept my custom DHCP rules for PXE boot images (saves me hunting for USB sticks if someone hands me a trashed system and it’s been invaluable over the years) so I’ve continued to run dhcpd separately from pi-hole. But you don’t even need to do that, all you really need is your existing DHCP server to accept custom DNS resolvers and any consumer router should let you do that. Just make sure you disable DHCP in pi-hole.
I too run a Gentoo server at home (fist bump), and I'm running `dnsmasq` for filtering and caching, and `stubby` for DNS-over-TLS, and I run this beauty of a cron job every morning:
curl -s --compressed -o /var/lib/dnsmasq/hostnames.txt https://raw.githubusercontent.com/notracking/hosts-blocklists/master/{hostnames.txt,domains.txt} | sed -e '/::/d' -e 's/0.0.0.0//g' -e '/thepiratebay/d' > /var/lib/dnsmasq/domains.txt && rc-service dnsmasq restart address=/example.com/0.0.0.0
into address=/example.com/
...which makes dnsmasq return NXDOMAIN instead of 0.0.0.0. I think that's more correct.That said, this is one of the drawbacks of freedom and choice. There are so many different distributions, each one with their own quirks, that creates a massive support burden for developers.
Should developers focus on developing their software, or focus on supporting their software on as wide a range of platforms as possible?
Docker in particular helps solve this particular problem. I agree it's not ideal.
The best thing you can do is contribute directly if your platform of choice doesn't have explicit instructions. If that's out of scope for your own skill set, and you don't have the time or inclination to learn on your own, then I'd recommend learning docker instead. It's not terrible.
I think that's entirely reasonable. Unsupported configurations are "unsupported" for a reason: because open source developers have a limited amount of their unpaid free time to devote to their project, a project you get to use for free.
> ... was closed by the developer as "only two people have asked about Gentoo"
Again, entirely reasonable. Maintaining installation scripts for your project for every OS under the sun is a large burden, especially for OSes that the developers don't personally run themselves.
Since Linux distros are basically the poster-child of fragmentation, the usual way to get a piece of software supported on your distro is to have a distro package (for Gentoo I guess that'd be an ebuild) that does any distro-specific patching. Stuff that's generic enough can be upstreamed. Stuff that is distro-specific often has to stay in the distro patches unless someone is willing to step forward and be trusted to actively maintain it upstream in the long term. As an open source project maintainer, I definitely would not want distro-specific code in my build if there's no one with the inclination or expertise to maintain it.
> essentially saying "please install package X/Y/Z" during setup
... and this is exactly something that goes in your Gentoo ebuild, not in PiHole's generic install.
> I know Gentoo is fairly niche as far as distributions go, but seeing popular software moving away from "here's how to compile/install it" to "here's a docker container/here's what "we" support" is very disheartening
I'm a little puzzled by this remark, since that's how it's always been with open source that's intended to run on Linux. I go back and forth on what I think about Docker, but before we had that, you basically got a tarball with a configure script, and had to figure out on your own what dependencies to install on your distro to get it to build properly. Some projects with more bandwidth would include an RPM Or DEB package, but oftentimes those would only run on a few specific versions of RedHat/Fedora or Debian/Ubuntu, and you'd still have to install the dependencies yourself. At least with Docker it's sorta a "build once, run anywhere" type thing.
The thing I don't think you're getting is that you are not entitled to these people's time or resources. They're putting out a project in the hopes that people will find it useful. It is not reasonable to expect them to cater to every whim of every potential user's personal setup.
I'm sorry for the long-winded reply here, but it really bothers me when people expect open source developers to have their free time directed by non-contributors.
Found one feature: per-client blocking. Anything else ?
- automatically updates the block lists each week
- supports regex filters
- has a admin web interface which makes it easy to view statistics and filtering log, edit the whitelist/blacklist, etc.
Updating automatically requires a cron job, which has to be added by the administrator using the GUI - adding it automatically is a future feature.
A couple of days later, it just mysteriously stopped working and I couldn't for the life of me figure out why. My theory is that AT&T detected my blocking and blocked my internet as a result. Is that too much of a tin foil hat theory? How can I know for sure?
I don't know too much about computer networking, only the basics.
...I've got some sketchy IOTs that I've been meaning to lock down a little more.
Anyone have the run down on Adblock plus Privacy badger UBlock origin Etc??
It does show you DNS requests counts and such per device, but that's a poor proxy for bandwidth.
[0] https://discourse.pi-hole.net/t/does-pi-hole-keep-the-lists-...
> https://www.calyptix.com/top-threats/3-common-dns-attacks-an...
Required to read the text of the announcement. No. Required to make donations via Stripe. Yes.
RSS does not require Javascript. Looks like the full text announcement.
Alternatively:
echo 159.203.180.3 pi-hole.net >> /etc/hostsThe above is no longer needed to avoid the Sucuri interstitial page.