How I use raspberry pi at my home to block advertisements on all devices and load webpages fast!

My father is not an avid internet user and he doesn’t understand or care for things like adblocker. I did install adblocker on his PC but many news sites and blog don’t allow you access if you have adblocker enabled. He keeps calling me all the time with problems that he is unable to access a webpage so I just disabled adblocker for him. That came with different baggage of problems altogether. He kept complaining me about the junk and popups he gets on different websites and I had to somehow fix this. So I decided to fix the problem for all devices at my home with a very small hack. After finishing my setup I thought of putting up the setup on my blog. So here’s how it goes.

I have a raspberry pi at my home which I use as a VPN endpoint to get access inside my home network for different reasons. I use pi for a lot of things but more on that later.

Installed pi-hole on my raspberrypi. Installation was too simple. Just copy paste of one line command the installation went through smooth without any issues. Configured DHCP Server on my router which was also took hardly a minute. If you are a newbie then they provide a very good guide for you here.

After this, I just disabled adblocker in my browser and bam, things changed. Webpages load so fast and all websites open without any hassle. 🙂  For the first time I am able to read the news websites without advertisements – even on my phone and tablet, it just works on all devices at my home.

The setup which I told you about was for a local network – like home or office but if you want to have a similar behaviour for your personal machine then there are better ways to do this about which I will write a separate article.

If you are interested in understanding the technicalities of how this thing works then please go through this article: How does pi-hole work? I strongly recommend the technical readers to go through this article. For the gist of it, whenever you open a website which has adverts, they are served to you through some domain. If you block access of your computer to that domain those advertisements won’t load. Pi-hole essentially runs a DNS Server which has a database of all those domains which serve advertisements. So whenever pi-hole receives a DNS query for such domain it simply returns a different IP which serves blank content so the adverts dont even get downloaded. Pi-hole can help you save a lot of data as well.

Btw, here’s a screenshot of how a Times of India page looked without pi-hole and with pi-hole.

With advertisements (Notice the right side)

screenshot-from-2017-08-20-13-44-44

 

Without advertisementsscreenshot-from-2017-08-20-13-42-52

 

Share

Comments

comments