# AdGuard - A better Pi-hole
Created: [[2024_04_22]] 22:02
Tags: #Software #selfhost
I am using [Adguard](https://adguard.com/en/adguard-home/overview.html) as [an addon](https://github.com/hassio-addons/addon-adguard-home) within my [[Raspberry Pi]] Home Assistant OS setup, and I don't know how it could get any better for network-wide ad-blocking than this. Unfortunately, you should not expect it to be able to block absolutely all ads on your network, but you will definitely catch a good number of them. Especially things like app telemetry which are constantly tracking everything you do on your internet connected devices.
## Setup
### Does your router allow you to set DNS records?
The simplest way to get Adguard running is to run it on some sort of a container and have it set to be your router's default DNS resolver. Doing this sets Adguard as your router's configured DNS resolver. Now, when a request for a domain name comes in, it goes through your Adguard server, and if the domain is on the blocklist, Adguard can block it with it's configured blocklists (which you can grab online).
### Does your router allow you to turn off it's DHCP server?
Normally the first option is preferable, but more and more nowadays, router's firmwares are being locked down (especially the ones provided by your ISP). So if you can avoid it, running only as a DNS server is preferable.
I ran into this with a 2024 version of Ziggo's Connectbox. Where it would not allow me to configure my DNS records to point to an internal IP. So the only other option was to configure Adguard as a DHCP server (which is what allocates internal IP addresses on your network). To set this up properly you need make sure to setup 2 things:
1. Enable Adguard's DHCP server and configure it (if you don't know what settings, I'd suggest using similar settings to your router's existing DHCP server as you know those should already work).
2. Running multiple DHCP servers on your network may break things so you need to disable your router's DHCP server
Of course you should probably read [Adguard's documentation](https://adguard.com/en/adguard-home/overview.html) around [setting up a DHCP server](https://github.com/AdguardTeam/AdGuardHome/wiki/DHCP) instead of this unspecific guide, but this is meant more as an overview for how things are set up in my network.
### Specific points of configuration
Here are a few discontinuous notes around things that I've tweaked for my setup:
- My upstream resolvers are set to DNS Quad over https, I appreciate that they are a privacy preserving service and I have a couple of their backup resolvers in my list as well
- My bootstrap resolver (the resolver that Adguard itself uses), is Cloudflare's 1.1.1.1 which is just one of the best and I trust Cloudflare to be stable for years to come.
## References
- [DHCP server setup by Adguard team](https://github.com/AdguardTeam/AdGuardHome/wiki/DHCP)
- [Adguard Home](https://adguard.com/en/adguard-home/overview.html)
- [Adguard Home Addon for Home Assistant](https://github.com/hassio-addons/addon-adguard-home)