📄 How I protect my home network using ControlD, ctrld, and Raspberry Pi

🇪🇸 This article is also available in Spanish → Leer en español

                        🧩 1. Introduction

In this post, I explain how I implemented a secure and private DNS solution to protect my home network using a Raspberry Pi, the ctrld client, and the ControlD service. This setup not only gives me speed and privacy, but also full control over DNS traffic from any device connected to my LAN.

What I value most is that all DNS queries are sent through the traditional port 53, so I don’t have to configure each device individually. The Raspberry Pi receives those queries and transparently transforms them into DNS over HTTPS (DoH) requests using my custom profile in ControlD.


🔹 2. Background

This solution emerged from my need for a fast, secure, and reliable DNS system for my local network — one that didn’t depend on public DNS resolvers or require manual configuration on every device.

My network includes many devices that don’t support DoH natively, such as IoT devices, Echo speakers, Chromecast, Fire TV Stick 4K Max, and Samsung Smart TVs. That’s why I needed a centralized solution that would accept traditional DNS requests over port 53 and forward them securely using DoH.

The implementation is based on the official documentation from ControlD and the ctrld client, along with technical guidance I developed through iterative sessions with ChatGPT to integrate all the components: Raspberry Pi, custom filtering profile, HTTPS-based queries, and monitoring automation.


🔧 3. My technical setup (step-by-step)

The setup uses a Raspberry Pi running DietPi, a lightweight and performance-optimized Linux distribution for ARM devices.

Here’s the process I followed:

  1. I installed ctrld on the Raspberry Pi and configured it to listen on 0.0.0.0:53, accepting DNS queries from all devices on the LAN.

  2. I created a custom filtering profile in ControlD with rules for logging, geoexit, and content filtering.

  3. I configured the ctrld.toml file to define the local IP, DoH endpoints, and client tag for proper identification.

  4. I configured my router’s DHCP server to distribute the Raspberry Pi’s IP (192.168.88.10) as the primary DNS, and a public ControlD IP as fallback.

  5. I confirmed that devices like Fire TV, Echo, and Smart TVs send their DNS queries to the Pi, which then securely forwards them via DoH using the ControlD profile.

  6. I implemented custom monitoring scripts integrated with Healthchecks.io to receive alerts in case ctrld fails or DNS resolution becomes unavailable.

  7. I also integrated msmtp to send email notifications, which allows me to receive alerts automatically without relying on manual log inspection.


💡 4. Practical use and recommendation

This setup is ideal for anyone seeking full control over DNS resolution in their home network, especially with devices that do not support DoH, such as IoT devices or smart displays.

It’s also a powerful alternative to public DNS resolvers like Google (8.8.8.8) or Cloudflare (1.1.1.1), providing encrypted traffic, custom filtering, and centralized monitoring.

Compared to tools like Pi-hole or AdGuard Home, which act primarily as local ad-blocking DNS servers, ControlD offers a robust cloud-integrated platform that delivers encrypted queries, logging, rule-based control, and remote visibility. It’s a more secure, scalable, and flexible solution.

Using DoH (DNS over HTTPS) ensures that DNS traffic is encrypted, which helps protect your network from inspection, tracking, or manipulation by ISPs, bots, malware, or third parties.

You don’t need advanced programming skills to deploy this. If you have a Raspberry Pi, a router, and curiosity, you can build a secure and auditable DNS solution for your home.

Tools like ctrld, msmtp, and Healthchecks.io allow you to create a DNS resolver that not only works, but also watches over itself.


🔚 5. Final thoughts

This configuration has significantly improved the privacy and reliability of my home network, without relying on closed or overly complex solutions.

It gave me enterprise-grade DNS control, adapted to my home environment — with encryption, filtering, visibility, and automation.

This is an evolving project: I’m constantly improving scripts, monitoring tools, and flow controls to keep everything stable and secure.

💬 Have you built something like this? Are you considering it? I'd love to hear your experience or help you get started.