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
kit today we're going to show you guys how to set up pi hole 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 going to drop it right now
like a mic
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 Linus and claim your
free licenses worth over seven hundred dollars we'll have that linked below
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 pihole 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've got your your
textures your dialogue your music etc well at that same time a request is
being made to the url of the server which manages ads for that app
your routers 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 pie hole does is stand in between
your dns provider and your device
then if pihole 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'll either be left with no add 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 kind of
complicated so how do you set it up
believe it or not it is simpler than you might think piehole 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 five dollar
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 os 2 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 going to assume you've got raspbian installed you've changed
your default password you've configured a static ip for your pi and you're sshed
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 blacklist
then the next screen is kinda where the magic happens
it's blackmagic 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 white listing common false positives
next we're going to 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 going to 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 black
listing 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 want to
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 going to manually point a couple of devices at
our pie hole like this iphone right here and the smart tv behind me both of which
have ads uh so Jake i don't think this tv is
actually going to let us change 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
nope this isn't looking great hey yeah try
that yes
should we 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 or yeah they are turned on you can toggle them on this tv but uh
yeah we might just have to go to the internet browser maybe it waits and doesn't like spam you with ads right out
of the box i mean
youtube would probably serve as an ad the thing is
youtube ad blocking with piholt isn't amazing because the url's changed so
much oh interesting um it might work yeah there's an ad in this instance okay
so let's give it a shot that is one thing with pie 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
and there's probably some repos that are pretty good for it but uh
dope yeah so 77.
oh god oh this is painful to enter i think you can talk to it
yeah that's definitely going to be better
okay you are connected to the internet blippity bloppity and close okay so i'll
pull up the pie hole thing on our laptop here okay let's try another video here
mine is tech tips pc build no dollar wasted pc build guide
nothing 1000 gaming pc build guide
nothing i'm surprised it's working
uh 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 going to 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 uh yeah
i just want to look at our user device list here okay so one of these it's
definitely this one this is yeah well 15 queries so
samsung ads blocked look at that whoa i can already see that
ads.samsung.com blocks look at that that's sweet just like that hey
okay well hold on let's see if it grabs let's see if it actually blocks anything
from youtube i haven't gotten any youtube queries yet so
let's try uh let's try a refresher yeah i don't know we haven't got any new
is this an ad the 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 luca oh never mind 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 one we're going to do
10.20.0.77 which is our pi hole and i'm not going to set an alternate dns server
because we don't want to you know 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
oh do we have ipv6 here i'll just turn ipv6 off yeah
there we go all right you're on okay let's try that again
okay wait a minute some of them are down yeah okay so sometimes
ads will get through and then we can take this actual url add
click.g.doubleclick.net let's try to remember that we go blacklist
adding to the blacklist success 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 like why is this so why are you
using edge what are you even doing just use chrome all right just right click
chrome open incognito tab okay so here we go there we go in chrome
and it's not working you're done bud no more ads okay so clearly it was just
edge dns caching but uh 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 going
to set it to manual we're going to add a server 10.20.0.77
you need to delete all the other ones and oh dang it yeah i guess that's true
there's so many but well no these were entered by us at some
point these are all like oh yes we would enter so now um actually speed test is
the one that we could check here as well it's an app right so i go ahead i click
go blah blah blah we are doing a speed test
that's actually kind of weak sauce yeah it's not that great look at that no ad
no ad it's gone so in this case we ended
up with the sort of the the blank spot
as opposed to just the element not loading at all because clearly their app
just has like a placeholder yeah
uh oh we should try flappy bird
it's on the bottom there oh i had uh i had actually loaded up a tweak town on
safari this might cache but oh it doesn't look
like it did nope wow they're gone bye dude try flappy
bird because that has like the old school banner ad on the bottom all right
go on it's not even there it's gone even within games
this is pretty cool so one more thing is now that we've been
tooling around with this stuff for a little while um i want to 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 um 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
in the us let's do it that they can reroute all their traffic through so i want to do that for like two years okay
so guys make sure you're subscribed we are going to do that video find diy
there you go but other than that i think that's about
it so pie hole 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 or
whatever the case may be all you do is take a domain plunk it into pie hole and
it's gone across the entire network that is unless your users are savvy enough to
configure their own dns uh 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 what we don't want to 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
autofills 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