 Okay, look, I know what you're gonna say. Linus, why are you showing me how to block ads? That's how you make money. And you would be right. YouTube's AdSense is a big portion of our revenue here at Linus Media Group. Guys, if you like this video and you do deploy the solution, please buy a shirt or a hoodie, lttstore.com, all right? But we also understand that many of the people who would be determined enough to set up something like this probably already have some form of ad blocker, probably in their browser. So, f**k it. Today, we're gonna show you guys how to set up Piehole, a DNS-based filtering tool that can be configured to block advertisements, tracking, and even known malicious sites and malware on your entire network with this. Wow, that was a good throw, you almost got me. A computer so cheap that I am gonna drop it right now, like a mic. Don't, don't. It's the only one we have. Speaking of the only one, it's been a while since one of our videos has had just one sponsor, like Smart Deploy. With Smart Deploy, you don't need any on-site IT. You can deploy images, apps, and scripts over local network or the cloud. So go to smartdeploy.com slash Linus and claim your free licenses worth over $700. We'll have that linked below. (*upbeat music*) Traditional ad blocking tools, like you would find on the Chrome store, like AdBlock or UBlocker, work from within your web browser. They analyze the incoming data sent to your PC when you load a website, and they remove or replace any content that is recognized as an ad. Now, this works great for that one browser or maybe even that whole computer. But what about ads on devices that don't have or allow ad blocking, like the advertisements baked into mobile apps or on your smart TV or even on the Google mobile discover page? That is where Piehole comes into play. So here's an example. You launch a mobile game on your phone and all the assets required by the game start loading. You got your textures, your dialogue, your music, et cetera. Well, at that same time, a request is being made to the URL of the server, which manages ads for that app. Your router's specified DNS provider then looks up that URL and replies to the phone with the IP address of that server so that it can load the ads. Now it's done this way, rather than just baking the ads into the app download because, among other reasons, it allows advertisers to dynamically serve individually tailored ads, even from multiple providers across multiple servers. What a Piehole does is stand in between your DNS provider and your device. Then, if Piehole has that requested URL in its blacklist, rather than forwarding the request along to your regular DNS provider and subsequently connecting you and whatever's on the other side, in this case, an ad server, instead, Piehole stops the request in its tracks and replies with an unspecified address, essentially telling the device, like your phone, hey, that ad server don't exist, sorry. So this is referred to as a DNS sinkhole. Now, at this point, depending on how your app or your device's advertisement code handles errors, you will either be left with no ad at all or an error, so no ad or no ad. Another cool benefit is that once you've configured it, this setup can be applied to practically anything, like blocking known tracking services, blacklisting adult sites from users on your network, or even preventing malicious sites or malware from talking to their controlling server. And that all sounds great, but for the less network savvy among you, it also probably sounds kinda complicated. So how do you set it up? Believe it or not, it is simpler than you might think. PiHole is designed to be highly compatible, and it can work on almost any Linux system, in a Docker container, or in a VM, so long as you point your DNS settings to it. Most people, though, deploy it on a cheap, embedded computer like this, $5 Raspberry Pi Zero, though. So to complete your setup, you'll also need a couple more things, a micro SD card, a micro USB power supply, and a micro B to ethernet dongle. We're assuming here that you already have some cardboard to house the Pi, a way to install the OS2 micro SD card, and an ethernet cable. Now, even with this setup, there are some command line moments that might be challenging for Linux novices, but we've created a full step-by-step tutorial, thanks Jake, on the LTT forum, which will be linked in the description below. For the rest of the video, we're gonna assume you've got Raspbian installed, you've changed your default password, you've configured a static IP for your Pi, and you're SSH'd into it. Our next step then is to navigate to the Pi-hole website and copy their one line install command, run it, and work our way to the networking section. We select our default network adapter, eth0, and then our desired upstream DNS provider. This is where the Pi-hole will forward a request if it's not in any of our blacklists. On the subject of blacklists then, the next screen is kind of where the magic happens. It's black magic, get it? Yeah, it's terrible. So here you'll find a handful of curated blacklists where you can select which one or multiple ones you'd like to use. We're gonna stick with the default as it seems to work pretty well with minimal false positives depending on your browsing habits. By the way, another thing that we've included in the tutorial on the forum is a great tool for whitelisting common false positives. Next, we're gonna leave filtering on for both IPv4 and 6, and assuming the static IP that we specified earlier is the one that Pi-hole shows on the next screen, we're gonna say yes to that as well. The rest of the settings, like whether to install the admin panel, the web server, and the logging mode, will be left at default, and should for you as well unless you really know what you're doing. Now, some processing will occur, and bam! You will be presented with the password and URL for your Pi-hole admin panel. Logging in then reveals a vast array of pages with analytics, a list showing you which devices are using Pi-hole or not, manual white and blacklisting, and configuration for your mass blacklists. It's pretty freaking cool and really customizable. Now, here's the thing though. When you set it up this way, Pi-hole will still only work on a device-by-device basis, so you will need to manually change your DNS settings on each one of the devices that might be on your network. If you wanna kick things up a notch and make it the default for your entire network and everything on it, you will need to change the settings on your router. Now, to avoid everyone getting mad, we won't actually be changing anything on the Office network, so we're gonna manually point a couple of devices at our Pi-hole, like this iPhone right here and the smart TV behind me, both of which have ads. So Jake, I don't think this TV is actually gonna let us change the settings. These are the expert settings. This is like the network engineer. You get to turn IPv6 on and off. Open network settings, maybe that one? No. This isn't looking great. Hey! Yeah, try that. Yeah. Nice. We should do it before. Can we even find an ad on this TV? I was looking earlier and I couldn't find one, so. Oh, so maybe they've cleaned up their act a little bit? Yeah, they are turned on. You can toggle them on this TV, but yeah, we might just have to go to the internet browser. Maybe it waits and doesn't spam you with ads right out of the box. I mean, YouTube would probably serve us an ad. The thing is, YouTube ad blocking with Pi-hole isn't amazing because the URLs change so much. Oh, interesting. It might work. Yeah, it might work in this instance. Okay, so let's give it a shot. That is one thing with Pi-hole, is the URLs change on YouTube ads so much and it's completely customizable by you, so you would have to kind of keep track of those video ad URLs to block them. And there's probably some repos that are pretty good for it, but dope. Yeah, so 77. Oh God. Oh, this is painful to enter. I think you can talk to it. Yeah, that's definitely gonna be better. F***, guy. F***. Okay, you are connected to the internet, blippity bloppity and close. Okay, so I'll pull up the Pi-hole thing on our laptop here. Okay, let's try another video here. Minus Tech Tips PC Build. No dollar wasted PC build guide. Nothing. Thousand dollar gaming PC build guide. Nothing. I'm surprised it's working. YouTube also doesn't serve an ad every time. This is true. So we might have to watch for a little while. So I'm gonna let this video play for a little while so that my viewer satisfaction seems pretty good. Actually, well, you can see if it blocks anything, right? Yeah, I just wanna look at our user device list here. Okay, so one of these, it's definitely this one. This is our TV. Yeah, well, it's the 15 queries. So Samsung ads blocked, look at that. Woo! You can already see that. ads.samsungads.com blocked. Look at that, that's sweet. Just like that, eh? Okay, well, hold on. Let's see if it actually blocks anything from YouTube. I haven't gotten any YouTube queries yet. So let's try a refresh here. Yeah, I don't know. We haven't got any new... Is this an ad? Click. Kind of looks like an ad. Is this just the video? I don't think so. Click with the thing. What even is this? This is the video. Oh. We kicked Luke out. Oh, nevermind, that's just our video. This is just a really weird video. Yeah. All right, so, I mean, success, I guess? Okay, so should we move on to... Actually, here, why don't we do a simple one? Let's do the PC. Okay. Speedtest.net, they're the worst. This came to mind as soon as I was looking for a site that has ads. This thing has literally five ads on one page. So if we go down here, open network settings, go to change adapter options. So if we go to... We're gonna do 10.20.0.77, which is our pie hole, and I'm not gonna set an alternate DNS server because we don't wanna give it any chances to not use it. Yeah. And then we close out here. I might have to flush our DNS, but let's just try it. Blippity bloppity. Yeah, you can flush DNS. Whoops. Oh, do we have IPv6 here? I'll just turn IPv6 off. Yeah. There we go. All right. And you're on. Okay, let's try that again. Oh. No. Okay, so- Wait a minute, some of them are down. Yeah, okay, so sometimes ads will get through. And then we can take this actual URL, addclick.g.doubleclick.net. Let's try to remember that. And go blacklist. Adding to the blacklist. Successed. Okay, so let's see. Wow, they're determined. They're determined buddies there. I think what it is is it's just caching the DNS. I don't know how to do this on Edge. Why is this so- Why are you using Edge? What are you even doing? Just use Chrome. All right, fine. Just right click Chrome, open incognito tab. Okay, so here we go. There we go. We're in Chrome and- It's not working. You're done, bud. No more ads. Okay, so clearly it was just Edge DNS caching, but yeah, no more ads on speedtest.net. Why don't we move on to the iPhone? So on here, configuring our DNS is again pretty straightforward. We're just gonna set it to manual. We're gonna add a server. 10.20.0.77. You need to delete all the old ones. And, oh, dang it. Yeah, I guess that's true. Oh, there's so many, bud. Ugh, ugh. Well, no, these were entered by us at some point. These are all like things we would enter. So now, actually, speedtest is the one that we could check here as well. It's an app, right? Yeah. So I go ahead, I click go. Blah, blah, blah. We are doing a speedtest. That's actually kind of weak, sauce. Yeah, it's not that great. Look at that, no ad. No ad. It's gone. In this case, we ended up with the sort of the blank spot as opposed to just the element not loading at all because clearly their app just has like a placeholder for that. That's just the background, yeah. Oh, we should try Flappy Bird. Flappy Bird? It's on the bottom there. Oh, I had actually loaded up Tweaktown on Safari. This might cache, but. Oh. Oh, doesn't look like it did. Nope. Wow. They're gone, bye. Dude, try Flappy Bird. Cause that has like the old school banner ad on the bottom. All right. Gone, it's not even there. It's gone. Even within games. This is so cool. So one more thing is now that we've been tooling around with this stuff for a little while, I wanna try again and see if we get a YouTube ad. So why don't we go with smallest, no compromises laptop. And nothing. This is working better than it was before actually. You know what would actually be really cool? Guys, if you liked this video, we should do that video you suggested a little while back. So one of the big problems with not necessarily YouTube on your smart TV, but Netflix, is that they have blocked most of the major VPN providers. So what they can't block is an individual setting up a US based, yeah, a DIY VPN based out of the US. Let's do it. That they can reroute all their traffic through. So. I wanna do that for like two years. Okay, so guys, make sure you're subscribed. We are gonna do that video. It's a DIY VPN. There you go. Other than that, I think that's about it. So, Piehole, super cool tool. Like aside from ad blocking, let's say there's a site or a domain or a pop-up that looks super spooky, or maybe you don't want your kids seeing, or you don't want your employees wasting time with, whatever the case may be. All you do is take a domain, plunk it into Piehole, and it's gone across the entire network. That is unless your users are savvy enough to configure their own DNS on their device, in which case you're pretty much hooped. So I think we're gonna change our Steam cache to a Steam blocker. This total game changer. Wait, what? No. We don't wanna play video games at work, you know? So anyway, I'm blown away by how much we can do with this computer. It's not that one exactly. That's fine, it doesn't matter. This computer that costs less than your non-fat, half sugar, mocha, latte, frap, or whatever that you got this morning. I guess it shouldn't surprise me that much, given how well this thing actually ran a surveillance server a while back. So if you guys are looking for something to watch now, you should definitely check that out. That's over here. Speaking of things you should check out, our sponsor for today's video, Privacy.com. Privacy.com is a free, easy to use service that hides your credit card number. It works by creating a virtual card number that is locked to whichever merchant you are shopping at. So even if that merchant gets hacked, the bad guys won't be able to just use your card anywhere they please. And if they try, you'll actually get a push notification so that you're always in the loop and you can cancel the card immediately. Cards are super simple to set up. You just need to create an account, link your virtual cards to your checking account or debit card, add a limit, and voila, you're all set. They've also got a browser extension that auto fills information for you when you're making a purchase. And Privacy.com is PCI DSS compliant. They use military grade encryption to secure your information, and they offer two factor authentication. And since they make money from merchants, there is actually no cost to you. So go sign up today. You will get five bucks for free at privacy.com forward slash Linus. That's privacy.com forward slash Linus. So thanks for watching guys. See ya.