Repolode
0xERR0R

0xERR0R/blocky

A fast, lightweight DNS proxy that blocks ads and trackers for your whole local network, with per-client-group rules.

Open-source alternative to:Pi-hole

Stars
7,053
Forks
316
Open issues
63
Last commit
yesterday

What is it?

Blocky is a DNS proxy and ad-blocker written in Go for local networks. It filters DNS queries against external block and allow lists, and lets you define different lists and upstream resolvers for each client group, such as kids' devices or smart home gear. Blocking can apply to the requested domain, CNAME records in the response, or response IP addresses.

Beyond filtering, Blocky can serve as a general DNS resolver. It supports custom DNS mappings for specific domains, conditional forwarding to external servers, and caching and prefetching to speed up repeated lookups. It accepts queries over UDP, TCP, DoH, DoT, DoQ and DoH3, and can validate DNSSEC on upstream responses.

Configuration uses YAML files, and the service is stateless with no database required by default. Query logs can be written as CSV or sent to MySQL, MariaDB, PostgreSQL or Timescale. It exposes Prometheus metrics, REST API endpoints and a CLI, and is distributed as a single binary and a multi-architecture Docker image for x86-64, ARM and MIPS devices.

Key features

  • 01Ad and malware blocking with external block and allow lists, including regex rules
  • 02Per-client-group lists and upstream resolvers
  • 03Custom DNS resolution and conditional forwarding
  • 04Response caching and prefetching of frequently used queries
  • 05Supports DNS over UDP, TCP, HTTPS, TLS, QUIC and HTTP/3
  • 06Prometheus metrics, Grafana dashboards and query logging to CSV or SQL databases

Use cases

  • Blocking ads and trackers across a home network without installing software on each device
  • Applying stricter filtering to children's devices through a separate client group
  • Running a private DNS resolver on a Raspberry Pi or OpenWrt router
  • Monitoring DNS query patterns with Prometheus and Grafana in a homelab

Quick start

  1. 1

    Read the installation chapter in the full documentation

  2. 2

    Run the Docker image from the README's documentation (installation guide)

Things to know

  • Requires a self-hosted DNS setup on your network, which takes some configuration effort.
  • Support for the project is mainly from a single maintainer in spare time.

In collections

Topics

FAQ

What is blocky?
A fast, lightweight DNS proxy that blocks ads and trackers for your whole local network, with per-client-group rules. Blocky is a DNS proxy and ad-blocker written in Go for local networks. It filters DNS queries against external block and allow lists, and lets you define different lists and upstream resolvers for each client group, such as kids' devices or smart home gear. Blocking can apply to the requested domain, CNAME records in the response, or response IP addresses.
Is blocky free to use? What license does it have?
blocky is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is blocky still maintained?
Actively maintained. The last commit to blocky was on Oct 23, 2026.
What can I use blocky for?
Blocking ads and trackers across a home network without installing software on each device Applying stricter filtering to children's devices through a separate client group Running a private DNS resolver on a Raspberry Pi or OpenWrt router Monitoring DNS query patterns with Prometheus and Grafana in a homelab
How do I install blocky?
Read the installation chapter in the full documentation Run the Docker image from the README's documentation (installation guide)
Where can I get blocky?
The source code and installation instructions are on GitHub: https://github.com/0xERR0R/blocky

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects