AdGuardHome(AGH) is a DNS server that also serves as a network wide ad blocker. This is usually the first application that I install because it not only blocks ads on entire network but also gives me the insight into the network traffic as you can see in above screenshot. I will be hosting this on my Raspberry Pi server
How it works?
The ads are primarily served by an ad network. These ad networks have specific domain. AGH maintains block lists of domains of these ad networks1. And when it encounters a request for one of these domain it returns a 0.0.0.0 response indicating the website was not found. The browser ends up rendering the page without the ad.
Above figure shows how it can similarly block malicious websites as well. This is the gist of it but if you want to learn more head over to AdGuard knowledge base here
I am only covering the installation steps briefly here which should be enough but head over to getting started guide if you encounter issues.
- Get binary from releases. For Raspberry Pi4 we can download
- Run the binary and follow the installation steps in the browser
- Provide static IP to your Pi from router configuration
- Point DNS server in your router config to newly configured AGH server
- Install systemd service using
AdGuardHome -installto run AGH as service
You are done. Try refreshing the dashboard after browsing couple of websites and you should see the stas.
There is an alternative to AGH called PiHole which serves similar purpose but it’s setup is exhaustive and needs Apache, MySQL, PHP to work. Needless to say I will not suggest PiHole. AGH is compact and written in Go. It has a single binary that is very easy to deploy. Here are some other things that you can use AGH for
- Create local domain for your home network
- Block certain services from their Filters -> Blocked services page
- Parental control, safe search and block malicious websites
- Apply custom filtering rules
- View query logs to analyse any suspcious app activity
Head over to AdGuardHome Github if you want to learn more.
- AGH cannot block YouTube ads because those are directly served from main YouTube domain nowadays. Blocking those would mean blocking access to YouTube. This was not true few years ago.