Quick and Easy Pi-Hole Ad Blocking

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today we're going to set up network-wide ad blocking with an inexpensive raspberry pi stay tuned today we're going to be installing pi hole it's a small lightweight dns server that was specifically tailored for the raspberry pi now you can run pi-hole on any linux based system however pi hole was designed to run on low-powered systems like the raspberry pi today we're using a raspberry pi 3 however i've seen people and i think it's most common to install these things on pi zeros just a ten dollar raspberry pi so you don't have to have a lot of initial investment into this thing to get it up and going i'd use my pi 3 because i already had it so i'm just repurposing it from another project to use for this now i already have this one set up with raspbian os i did that ahead of time if you want to know how to get raspbian up and going i did a video a while back on how to set up a retro gaming system and i go through the whole process on how to flash the sd card i'm not going to go over it again in this one but i will tag it in a video right here so now without further ado let's get pie hole set up so once you have raspbian set up the first thing i would do is come into preferences here and go to raspberry pi configuration if you haven't already changed your password i would do that now i've already changed mine so what you want to click on is interfaces and then you want to enable ssh this is going to come in handy later once we do that open the console and there's only one command that we need to type i'm going to type it now so once you type the command just hit enter and it'll go through and find all the stuff it needs to install all right so now what we're going to do is we're going to hit okay ok again and again and then we're going to go through the configuration here you pick which interface you want pi hold a function off of obviously we're going to use ethernet zero then we're going to pick our dns server you can pick google open dns level 13 you can pick whichever dns server you prefer or you can set up a custom one i already have open dns set up so i'm going to select that i'm going to keep the default add lists i'm going to select ip4 and 6 for the protocols that it's going to filter and then here it wants to know if you want to use your current settings as a static ip address you need to set up a static ip address on pi hole in order for other computers in the network to be able to find it because you have to actually point these computers to the pi hole and i'm going to show you how to set that up in your router after we do this but i don't want to use the default here i want to set up my own static ip so i'm going to click no and then for my static ip i'm going to set up two default gateway is the same then hit yes and then we'll move on and yes we want the admin interface yes we want to install a web server yes we want to log queries i'm going to set this up to show everything but you can change the level of privacy that you use here if you want i'm just going to use everything here and then give it a second and it will go ahead and finish the installation i'll speed this section up right here so it doesn't take so long okay now that the setup is finished you'll see the screen right here that will tell you your ip address as well as they will automatically generate you a password however i am never going to remember this password so i'm going to show you how to change that right now go ahead and just hit ok and then you want to type in s you do pi hole dash a dash p and it's going to ask you for a new password and there we go that's all it takes to set up pi hole now we need to configure our network to be able to actually make use of it so we're going to do that right now all right now that we have pi hole set up it's time to actually make use of it and the way we're going to do that is by modifying the settings in our router however before we do that let's talk about how dns works real quick and how pihol makes use of this to our advantage when you open your browser and you type in a web address let's say google.com the computer has no idea what google.com actually means so what it has to do is go out to a name server and that name server will actually resolve google to an ip address that corresponds with a computer on the internet now this has a couple of benefits first off if you're connecting to google google has mirrors all over the world so obviously if you're in california you don't want to connect to a server that's in germany it's simply going to take too long your internet's going to be too slow so what the name server does is not only does it resolve the domain name to an ip address but it gives you an ip address to a server that's located in a close geographical area to you now the way pihole takes advantage of this is that when you open a web page the ads on that web page are served from different domain names so when the web page requests an ip address to those domain names pi hole using a list of known advertising sites simply blocks the request it comes back as nothing so what the computer thinks is it thinks that the servers aren't available so it just loads the page without ads this is essentially the way that host name blocking works if you add known ad servers to your host file then your computer simply ignores them you just reroute them to 127001 and it opens nothing so in order to make this work we have to set our router up to use the pi hole as its primary dns server in fact we want to set it up to use the pi hole as our only dns server so that way computers can't get around the pie hole in order to get to another dns server in order to load ads so to do that let me show you how now the first thing that we're going to want to do is open up chrome and in chrome we want to type the ip address of the pi hole we set up earlier so it's 192. and then we want to click forward slash admin and this gives us our admin page now the reason why i have three queries is because i've already had a pie hole set up with the same ip address and there's probably a computer on the network that's still doing dns requests to the old pie hole so what we're going to do now is we're going to open up our router my router's ip address is 192.168.0.1 we're going to log in i'm using ddwrt firmware on my router your router is going to look different however if you can get a ddwrt compatible router i highly recommend it it's a great firmware it works really well and some of the settings that i'm actually going to set up right now you're not going to have available to you without something like this so let's go through this real quick so what we're going to want to do is on our setup menu we want to go down and we want to find where we can specify a dns address so right here i currently have it set up to open dns so what we're going to do is change this to 192. one six eight zero two and then what you're gonna wanna do is for this the static dns two and three what i recommend doing is just putting nonsense addresses in here so that your isps dns won't actually take over so i'm gonna put one nine two one six eight zero i'm gonna put three and then i already have the static dns set up as four now obviously these two ip addresses don't even exist on the network they're just nothing so they'll come back as nothing and the way that dns works is it's not like if this ip address isn't available it falls back on the second one what the router will do is it will actually load balance between all your name servers so that sometimes it'll hit this one sometimes it'll hit this one sometimes it'll hit this one now if one of those are down it'll fail back to another one so since both of these don't work it's always going to fail back to the original one so what happens is if you set up your pi hole to use its proper ip address and then you also have your isps ip addresses here then what's going to happen is every third time you connect to a web page it's going to be getting its dns from a different location from your pi hole and that's not going to work with ad blocking so what we're going to do now is we're going to hit save and then we're going to hit apply all right now that that's set up there's one other setting that if you have a ddwrt router i would recommend you changing go into services here scroll down to your additional dns mask options and then right here type this command in and i'll actually have this text right here in the description so you can type it into yours as well but you're gonna highlight the ip address here for the dns server and it's gonna be 192.168.0.2 and then we're going to hit save and apply and essentially what this is going to do is regardless of the dns servers that you had set before it's going to give the computer this ip address and this ip address only for its dns server if you don't have ddwrt then this is irrelevant for you you can just skip this part then the only option you have is to go into the setup menu and set static dns servers however if you do have it i recommend using this setting right here because it will actually disregard your static dns servers and give this as the only dns to every computer that attaches to the network and let me show you how that works so now that we have this set up we're going to open up our network settings we're going to go into our adapter settings and then if we open up this adapter you'll see here that the dns server is set to open dns right here so what i'm going to do now is i'm going to disable it and then re-enable it what it's going to have to do is it's going to have to ask the router for all its ip information again so now when we open this up you'll notice that we now have our only dns server as the pi hole so now when we hit close close we close all these windows here so now when we open up the pi hole right here it shows we have three queries now let's just do i'm going to do an internet speed test and then i'm going to go to speedtest.net this website is usually just cluttered with ads okay now what we're going to do is we're going to go over to our pie hole here and as you can see it's already blocked 19 ads and it's done a total of 131 quarries now it's got five clients attached to it so other computers on my network are actually already starting to attach to it so if we look at the query log here we can see all of the different sites that have actually been blocked and it looks like a lot of them have been amazon so there's lots of things that you can do with this you can connect to a white list so if there's any web page that this blocks that you don't want it to block you can always add it to the white list or you have a blacklist where you can actually add websites to a blacklist if you want to do it that way and that's all there is to setting up pihole now you can always go back to your control panel if you want to change any settings or if you just want to see the stats of what's going on now is it worth actually running this well there's a lot of hype out there saying pi hole is the ultimate ad blocker well i have to say that i highly disagree with that it's great it really is it's a great system it's a neat way to make use of a raspberry pi but it's got a lot of limitations unfortunately and some of those limitations are in my opinion kind of critical unfortunately and it's not their fault i mean the pie hole functions exactly how it's supposed to and for a dns based ad blocker it's amazing it works really well but as an ad blocker in general unfortunately a lot of websites can easily get around it for instance the primary reason why i set up pi hole in the first place was to block youtube and hulu ads on the roku and unfortunately neither of those actually work and the problem is is like take youtube for instance on youtube they serve the ads from the same cdn that they serve the content from and they use an algorithm to create multiple third level domains and it's just a never-ending game of whack-a-mole and unfortunately once you block an ad server they'll end up giving content through that same server and then you've actually blocked regular content i set up a list that promised to block all youtube ads and unfortunately all it showed was ads and the first youtube video i went to watch it wouldn't load i've just given up on trying to block youtube ads it's just not worth it and in all reality i disabled u-block when i first set this up because i wanted to give it its all i wanted to see exactly what this thing was all about and it took me about an hour to re-enable u-block and decide that browser-based ad blocking is just way better and unfortunately it's based on the technology with a browser-based ad blocker it can actually look at what's loading it can block things based on rules as well as blocking domain names with a dns based ad blocker unfortunately it's stuck with blocking dns names only that's all it can do it can't actually look at the packets that are coming through the dns server to see how they're actually coming together if they were able to do that it would take a massive amount more power than a raspberry pi for sure so is pihole the ultimate ad blocker no it's really not um it's still way behind browser-based ad blockers and unfortunately like i said it's not their fault it's not what the technology was intended for and that's just the way it is but however there's some great benefits to pi hole if you want to learn how dns functions or if you want to have more control over your network if you want to block netflix so your kids can't get on netflix over certain periods of the day well then you can use piehole to do that there's lots of different functions that you can use it for that are extremely helpful and the fact that it runs on a small raspberry pi is just amazing it takes up very little space and it uses very little power so it can just sit in the corner and do its job and be ignored and simply work the other benefit to pie hole is it's also a dns cache so when you request a domain name and it gets the response to that it can cache that result so the next time you go to that website it's a lot quicker accessing the page your internet will actually feel snappier by using a dns cache like this now most browsers do this anyway however when you close the browser and reopen it again you have to rebuild your cache again most of the time depending on the browser so even though pie hole didn't work out the way that i wanted it to i do plan on leaving it on my network it has a lot of great uses and to be honest with you a lot of the benefits i didn't even really consider before setting it up so i do plan on leaving it on my network so if this video was helpful to you then please like this video and don't forget to subscribe to my channel and hit the bell icon so you can be notified of future videos i post a new video every week have a great day
Info
Channel: CyberCPU Tech
Views: 11,665
Rating: undefined out of 5
Keywords: pihole setup, raspberry pi, ad blocking, dns ad blocking, dns ad blocker
Id: bXUCgQDGODQ
Channel Id: undefined
Length: 16min 32sec (992 seconds)
Published: Mon Sep 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.