Skip to content

wip: Dns bind forwarders dot#5545

Draft
bryanwieg wants to merge 8 commits into
opnsense:masterfrom
bryanwieg:dns-bind-forwarders-dot
Draft

wip: Dns bind forwarders dot#5545
bryanwieg wants to merge 8 commits into
opnsense:masterfrom
bryanwieg:dns-bind-forwarders-dot

Conversation

@bryanwieg

@bryanwieg bryanwieg commented Jul 10, 2026

Copy link
Copy Markdown

Important notices

Before you submit a pull request, we ask you kindly to acknowledge the following:

If AI was used, please disclose:

  • Models used: Deepseek v4 Pro, Claude, GLM 5.2, and GPT-5
  • Extent of AI involvement: I handled design and decisions. It assisted with testing, investigation, code generation, review, commits, commit messages, and PR generation.

Describe the problem

BIND 9.20 supports native DNS-over-TLS forwarders with both Strict (RFC 9103) and Opportunistic TLS, but the plugin had no GUI support for configuring them. Per-forwarder destination ports were also unavailable — the legacy forwarders field was a flat CSV with no per-row configuration.

While working in this area, two other issues surfaced: the DNSBL blocklists had been unmaintained since 2018 while Unbound's equivalents are actively updated, and the primary zones/records grids had layout problems. The plugin also lacked TSIG key management and a supported way to publish DHCP leases into forward and reverse zones. Reverse zones required manual ARPA setup, listener selection differed from Unbound's interface-based model, and outgoing zone notifications could not be disabled.

Describe the proposed solution

  • DNS-over-TLS forwarders (primary) — Add a "DNS Forwarders" tab with grids for plain DNS forwarders (IP + port) and DoT forwarders (IP + port + TLS hostname). DoT connections use Strict TLS when a hostname is set, Opportunistic otherwise. A model migration converts the legacy forwarders CSV into the new grid. The General tab also offers Forward First and Forward Only modes.
  • DNSBL from Unbound — Source the DNSBL type dropdown and blocklist fetcher from Unbound's XML model and blocklists.conf template at runtime, keeping BIND in sync with Unbound's maintained lists without separate upkeep.
  • DHCP dynamic DNS — Add TSIG key management and a lease watcher for ISC DHCP and Kea. Configured mappings publish active A, AAAA, and PTR records with nsupdate, persist state, and handle watcher lifecycle through configd. Split the former monolithic configuration view into dedicated Zones, Records, Access Control, and Forwarding pages.
  • Reverse zones — Add a reverse-zone domain type, source subnet, reverse-zone API, and Reverse DNS page. The subnet selector presents canonical interface subnets, derives the appropriate reverse-zone name, and supports DHCP watcher PTR updates.
  • General service control — Select BIND listener interfaces the same way as Unbound, with a migration that maps existing explicit listener IPs to their owning interfaces. Add a General-tab option to disable outgoing zone NOTIFY messages.
  • GUI fixes — Move primary zone records to a dedicated page to prevent the records grid from collapsing, and adjust grid column sizing for long zone names.

Related issue

Closes #5546

@bryanwieg
bryanwieg marked this pull request as draft July 10, 2026 19:53
@bryanwieg

Copy link
Copy Markdown
Author

I have submitted this pr now to invite any feedback or guidance from the maintainers.

I still have to create an issue, and I also am in the process of more thoroughly testing these changes in a working environment.

@bryanwieg
bryanwieg force-pushed the dns-bind-forwarders-dot branch 2 times, most recently from 315470c to 2c4fd3f Compare July 14, 2026 03:31
The primary-zone and primary-record grids shared a tab, causing the lower
records grid to collapse instead of using its configured row count. This
made records difficult to inspect and edit for zones with more than a few
entries.

Move primary records to their own tab with a full-height pane, remove the
now-redundant zone filter, and add pagination. Pin only the enabled and
action columns so zone names and record values can use the remaining space.
@bryanwieg
bryanwieg force-pushed the dns-bind-forwarders-dot branch 2 times, most recently from a63969b to 1d6e62e Compare July 18, 2026 03:22
@bryanwieg

Copy link
Copy Markdown
Author

got this running on my ha setup, with a dot upstream service. so far so good.

yes, I added more stuff to make it parity with unbound. please let me know if some of this is better suited for separate mr's, or other changes i need to make instead.

I've made quite a few assumptions, so i welcome feedback. the commits are split per feature.

@bryanwieg
bryanwieg force-pushed the dns-bind-forwarders-dot branch 9 times, most recently from ac25575 to d795063 Compare July 23, 2026 21:32
BIND maintained its own DNSBL definitions even though they had not been
updated since 2018, while Unbound's equivalent lists continue to be
maintained. Separate copies would inevitably drift.

Populate the BIND DNSBL selector from Unbound's model and resolve selected
shortcodes against Unbound's blocklists template at runtime. Replace the
shell fetcher with a Python implementation that validates and normalizes
hosts and Adblock-style entries before writing the RPZ include.
The legacy forwarder setting was a flat list of addresses, so it could not
configure per-forwarder ports or BIND 9.20's native DNS-over-TLS support.
It also offered no way to require forwarding rather than silently falling
back to recursive resolution.

Add a Forwarder model, API, dialogs, and a dedicated Forwarding page for
plain DNS forwarders and DoT forwarders. Render TLS profiles with strict
verification when a hostname is supplied and opportunistic TLS otherwise;
combine both forwarder types in BIND's normal SRTT pool. Migrate legacy
forwarders into the new model and add a General-tab Forward First/Forward
Only selector that renders the corresponding BIND directive.
The plugin had no supported mechanism to publish active DHCP leases into
BIND zones, and its single configuration page combined unrelated grids,
which made zone, access, forwarding, and record management difficult to
navigate.

Add TSIG-key and watcher models, APIs, dialogs, and dedicated Access,
Zones, Records, and Forwarding pages. Implement a Python watcher that polls
ISC DHCP and Kea leases, persists state, and uses nsupdate with TSIG keys to
maintain A, AAAA, and PTR records. Generate watcher configuration and BIND
update policies, add configd lifecycle actions and logging, and expose DHCP
records through a sortable API-backed grid.
Reverse zones required manual ARPA zone names and did not retain the source
network needed to create correct PTR records from DHCP leases.

Add a reverse domain type and source-subnet field to the domain model. Add
the Reverse DNS controller, page, dialog, and API endpoints, derive reverse
zone names from selected interface subnets, and render reverse domains as
primary zones so the DHCP watcher can update their PTR records.
Explicit listener addresses become stale when an interface address changes
and differ from Unbound's interface-based configuration. The initial
implementation also left generated listener directives absent at service
start.

Replace the IPv4 and IPv6 listener lists with a dynamic interface selector.
Migrate explicit configured addresses to their owning interfaces while
preserving wildcard listeners. After template generation, render listen-on
directives from the selected interfaces and loopback address, invoke that
step during BIND startup, and register DNS port conflicts only for wildcard
listeners.
The plugin release must identify the new forwarding, dynamic DNS, reverse
zone, notification, and listener-selection functionality so package users
receive the complete updated runtime tree.

Set the plugin version to 1.36 with revision 1 and expand the package
description to mention the added BIND capabilities.
@bryanwieg
bryanwieg force-pushed the dns-bind-forwarders-dot branch from d795063 to 2bcaeb8 Compare July 24, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

dns/bind: add DNS-over-TLS forwarder support and sync DNSBL from Unbound

1 participant