
Setting up Pi-hole to get rid of Internet advertising
In this post I want to bring you a product that can be deployed in 5 minutes and it will free us from all the advertising we see when we browse the Internet, It's that easy! We can make people in our office or our home navigate in a safer way, simply by installing in a virtual machine or a Raspberry Pi a software that will hide all the publicity!
We will not have to install anything on the equipment, or in browsers, simply by deploying Pi-hole we will make all computers use this computer as a DNS Server (or we put it as a forwarder on our DNS servers on the network), From that moment on, computers will not see any advertising banner for any ad when browsing.
Pi-hole works with a blacklist system when it comes to DNS queries, avoiding resolving domains that are marked to serve advertising, There are currently more than 129.000 Domains on Black Lists. We will improve Internet data consumption somewhat, that we will be able to see from the Pi-hole consolta, we will see what we save and all the queries that our devices make where they should not.
Installs with 1 command only, We must think carefully about where, in a house we could use a Raspberry Pi (with Raspbian Jessie or Stretch), and in a company we can deploy a virtual machine with Ubuntu: 16.04 / 16.10, Debian: 8 / 9, Fedora 28, Centos: 7. And of course it is also in container format for those who prefer it.
Well, after configuring with a static IP address and having the operating system updated, We proceed to install it, It will be enough to execute:
[SourceCode]curl -sSL https://install.pi-hole.net | Bash[/SourceCode]
Start a short wizard, Pressed “OK” To follow,
If we want to thank the work, the address for donations, “OK”,
It will indicate that we need to have static IP configured. Basically because all the other devices on the network will make DNS queries to it and filter them! “OK”,
Select the DNS server that we want the machine to use to make the name resolutions, In a home it is clear that we will use public, in a company it would be a good idea to put our DNS server here.
By default we will use all the lists that Pi-hole brings to block ads, “OK”,
We indicate whether we want IPv4 and/or IPv6 and “OK”,
We confirm the network parameters with “Yes”,
“OK” to take into account to exclude the IP we are using from DHCP servers and thus avoid IP conflicts,
We leave by default marked “On” to have a web admin panel, “OK”,
“OK” To use lighttpd as a web server,
And we also allow DNS query logs to be saved, “OK”,
… wait a few seconds while you enter the settings and start…
“OK”, we will see the address we will have to access and the password to hallucinate…
But first of all, Now we have to make mobile devices, Portable, etc… Resolve with Pi-hole IP, Stop that, on our DHCP server we will instruct them to use the IP address of the Pi-hole machine as a DNS server. Or as I said, If we have a company, we can have our DNS server use as a DNS forwarder to this machine and track!
GOOD, and this would be an approximation of what we would see! All DNS queries that are made, The blocked ones, what was saved and cached… And if we investigate, we can see which addresses make which DNS queries, Very very interesting! The 45,8% of the DNS queries made in my environment are to advertising links! Oh my god,
And here is an example of how it would look for example when browsing the Marca website:
I hope you have been interested!