A long time ago we made a Pi into a WiFi gateway that also blocked ads but the Pi Hole project does a way better job!
This project will make your Pi Zero W act as a DNS (Domain Name Server) The kind of device that tells you that adafruit.com is known as IP address 126.96.36.199.
Except Pi Hole DNS will do a special trick, when it is asked for the IP address of ads.adserver.com (for example) it will return nothing! So you will never even connect to the ad server and get the ad. Your connection will be faster, less data, and no intrusive ads. It works great on computers, tablets, phones, etc. Even if you cannot run an ad-blocker plugin on your phone or tablet, this will work and ad-blocker-detectors can't tell you're running it.
Unlike our WiFi gateway demo, you do not have to set up the Pi as your access point, you will only use it as a DNS ad blocker so it will not act as a bottleneck
We upgraded our Pi Zero Pi Hole with a little display, that makes setting up clients easy and also gives you some nifty stats!
Follow along with this guide to DIY your own