I ran Pi-hole as a docker container for several years now in order to block various unwanted DNS requests in my home network. That kind of worked but I had a lot of issues that I wasn’t able to solve or at least to figure out what caused them.
A few days ago this went sideways in a way that my entire network became unusable. So I decided to get rid of Pi-hole and use the normal DNS servers provided by my ISP.
I considered using AdGuard Home but I’ve read many things about it that let me hesitate. Fortunately I stumbled accross Blocky after looking for an altenative.
Blocky is a quote “DNS proxy and ad-blocker for the local network written in Go”. It ticked several of my checkboxes:
- Docker container available
- Small footprint
- Open Source Software
- Easy to configure
So I gave it a shot and it didn’t dissapoint me!
Here’s my docker-compose.yaml snippet
|
|
And my config file (slightly redacted 😏)
|
|
This config is mostly based on the reference config file
I copy and pasted this reference config file to my config.yml and started commenting out most of the file.
My router is a Mikrotik hAP which also acts as my DHCP server. So the only thing I had to do is to set the IP of my server in the DHCP server confog as DNS server address:
|
|
Whenever a client obtains a new DHCP lease it gets this IP as DNS server and all its DNS queries are served by Blocky.
I don’t bother that Blocky does not come with an UI for its configuration, for me that even a plus. But not having nice graphs was something that needs to be solved.
On a cloud server I already run Prometheus and Grafana wanted to use that for visualisation of Blocky’s data.
To make the /metrics
endpoint of blocky available for Prometheus I set up a subdomain metrics.tld.de
which is a CNAME for my DDNS.
Next I setup my local caddy to reverse proxy the /metrics
endpoint:
|
|
As you can see I configured HTTP basic auth so that not everybody can query the data. In my Prometheus scrape config I set this up as a target using the basic auth credentials:
|
|
Blocky provides a ready to use dashboard for Grafana but that wants an API endpoint. I couldn’t figure out how to set this up properly as my Prometheus instance is not on the same network as my Blocky instance, so I edited that out and made my own version
All in all I’m very happy with Blocky. It was such a smooth experiance compared to Pi-hole that I can only recommend to switch to Blocky 😎