Is there a solution for automatically adding a DNS alias in pfSense based on Docker container labels?

Hello everyone,

I’ve been researching a way to automate adding DNS aliases to an existing host override in pfSense (unbound) whenever Docker containers start, but I haven’t been able to find a solution. I wanted to reach out here in case I’ve missed something or if someone has already built a similar tool.

Here’s what I’m trying to achieve:

  1. Scenario: I have a host override in pfSense for a reverse proxy caddy.mydomain.com.
  2. Goal: Automatically add aliases to this host override whenever new Docker containers are launched, based on specific labels in their configuration (e.g., pfsense.dns.alias=my-new-service.mydomain.com).
  3. Reverse-Proxy Agnostic: The solution should work regardless of the reverse proxy being used (e.g., Caddy, NGINX, Traefik, etc.).

I’ve searched extensively and have found tools that work with specific reverse proxies – mostly by redirecting *.example.com to the reverse proxy – but nothing that is generalized for this type of integration with pfSense. I’ve also explored using other DNS solutions (e.g. Pi-hole, AdGuard Home) but would like to keep my DNS in the firewall.

If such a solution exists, I’d greatly appreciate a nudge in the right direction. If not, I’d love to hear any thoughts or recommendations on what you’d like to see in such a service should I decide to build it myself using the pfSense and Docker APIs.

Thanks in advance for your insights and help!

Welcome to the forums, but I am not aware of any tools that will do that automatically.

Thanks. I ended up building it myself, so if anybody is interested, check out the GitHub project: https://github.com/toddawhittaker/pfsense-docker-alias

Also, @LTS_Tom, what’s going on with The Homelab Show? I loved listening.

1 Like

We are revamping The Homelab Show, should be back in a month or so.