Matthew Ferrari

matthew@mmferrari.com

Xfinity DNS and Pi-Hole ad blocking

Date written: 8 Nov 2025

I currently rent an Xfinity router for my apartment next to University. I thought it would be fun to set up a Pi-Hole DNS server to route all my internet traffic through a Raspberry Pi 4 running in my apartment and block unwanted ads from Big Tech. As a customer of Xfinity, I was quite displeased to learn that Xfinity doesn't like people trying not to have their data sold to advertisers, in the case that I am not able to change the DNS server of the router I pay for from Xfinity.

Basically, in layman's terms, I don't want ads given to me on my devices. I want to create a filter that looks at requests made by my applications, like YouTube or Netflix. The filter (the DNS in this case, even though that's not all a DNS does, bear with me) would look at what links are being requested, and it would block common ad-serving HTTP requests, ones that start with something like "ads.google.com". Well, Xfinity said nice try, we aren't going to allow you to change the DNS from our amazing DNS (it's shit and slow), and we are going to sell all your browsing data to the highest bidder. So I'm a little pissed about this. However, like anything in tech, there are ways around this. So my next update will be about bridging my router to a non-Xfinity router, hopefully!

update: 9 nov 2025

I have set up Pi-Hole on my Raspberry Pi 4 and set it to my DNS on my personal computer. I am doing this to test how well Pi-Hole works and see if there are any bugs that keep me from using my laptop as I would normally. I set up my 1st DNS as the Pi-Hole and my 2nd DNS as a well known and trusted DNS, Cloudflare. This allows anything that is recognized by Pi-Hole to be forwarded to Cloudflare and allow be to browse seamlessly. I've noticed the the hole seems to be working as I haven't seen an ad in the past day. I've browsed news websites and youtube and I have not received an add. I still want to test out Netflix and Hulu to see if their ads will also be blocked. So far so good! I am really enjoying my ad-less experience and hope to set up a 2nd router soon so my entire network can be ad free!

Pi-Hole Network Setup

Update: 12 Nov 2025

On monday I bought a $30 netgear AX1800 router off facebook marketplace. It's probably nicer than what I need, but the price was good and I can continue to use this for years to come. I was super excited to set up this router with the Pi Hole. Things were going my way. I needed an Ethernet cable and found one for super cheap at the thrift store. I finally have everything I need to set up network-wide Pi-Hole ad blocking. However, I didn't fully set up the Pi to the new router until the next day. I was interrupted by some friends in the middle of my setup. Congrats, Tyler, on the internship! We went to celebrate.

What I ended up doing was connecting the Netgear router to the Xfinity router with an Ethernet cable, giving the Netgear router its own wifi network. This created a second network. I wasn't expecting this, however, I later learned that I didn't need to shut down my Xfinity network for Netgear to work, so I am keeping it running at the moment. So I suppose I'll make the Xfinity network a guest network.

My setup went a little something like this. I connected the Xfinity router to the Netgear router, and connected the Netgear router to the Raspberry Pi. I then booted up the Netgear router and configured the initial setup from the Netgear app. I then ssh into the Pi and disable the Wi-Fi since I was now using Ethernet, and didn't want the Pi to accidentally connect to a wifi network. I then switched the static IP address from the Xfinity router with IP 10.0.0.X to the Netgear 192.168.X.X. A static IP is needed so all accounts can connect to the network and the DHCP. I turned off the DHCP on the Netgear router and gave that responsibility to the Pi. This means whenever a device connects to the Netgear network, the IP and DNS settings are decided by the Pi instead of the router. This way, all devices connected will be connected to the Pi Hole as the device's DNS!

I connected my devices, and the results are different. YouTube: my laptop has no ads, phone and Roku have fewer ads, but still some Roku TV has ads on the UI interface blocked, but not on streaming services like Hulu or Netflix. This doesn't mean the Pi is not working. These streaming services have found innovative ways to bypass PiHole at times. No method is ever foolproof. I added 7 lists of blocked domains and regular expression blocks to maximize the amount of traffic that is stopped. This could come at a cost where certain domains cannot be reached, but that road will be crossed if needed.

Would I recommend setting up Pi-Hole on your network? This process was confusing, different, and frustrating at times. However, I would strongly recommend that anybody do this. It taught me so much about networks. I learned what routers do, the protocols that routers use, how they communicate with requests and responses, and how much data is collected on my devices. The blocked links log is crazy, URLs are constantly being requested by every website you browse, every streaming service, and even your TV Operating Systems. My Roku sends logs every couple of minutes. That's so weird. This helped open my eyes to privacy, and even though it doesn't block every ad (yet), I will continue to do this in every home I live in.