dns/bind: add DNS-over-TLS forwarder configuration - #5545
Conversation
|
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. |
315470c to
2c4fd3f
Compare
a63969b to
1d6e62e
Compare
|
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. |
d795063 to
2bcaeb8
Compare
e97697f to
6bafb48
Compare
|
Hi, There are so many changes in this PR, its impossible to review (for a human). It looks like a complete rewrite by AI and I have no idea how to maintain this in future. :( |
|
Hi @mimugmail and @bryanwieg I am trying to achieve the same thing (want to add DoT forwarders) in bind on opnsense. Can I suggest that we just add another directory to add custom options as suggested in here: #5546? I can write this up as a pull request (as a human as it looks pretty easy based on what was done for #4773) if you would be open to that? Thanks for your consideration!! |
|
@maloo1 if it's just a couple of lines (it think it shouldnt be more), sure. Problem is, real humans can't audit such code in spare time. I ran this PR against my Claude Pro for fun, it's too big :) |
|
Thanks @mimugmail - I have created a pull request in #5588 - I think its pretty simple and i have tested it on my setup and is working well. Thanks again |
|
I agree. I got carried away working for parity with unbound. And the PR is too large. I haven’t updated comments yet as I continue to run it and look for bugs. One of, if not the last, thing I need to do is doublecheck migration scenarios. I had just started to write last night actually, I know it is large. Right now the PR is split into eight commits per future change. But I wanted feedback about splitting up the PR, or just a different approach in general. I don’t know. You guys let me know what you would like. I’ve been running it for about a week or two. It’s doing what I need and it nearly completely replaces unbound. |
|
@maloo1 you may want to verify at home that the DOT forwarders work. There’s a bug report in BIND about a regression introduced recently breaking DOT. At home I reverted to an earlier version of bind for it to work. I’m at the doctor this morning, so I’ll have to get you details later. |
|
One option is that we pull out the other commits and leave this one focusing on the DOT. |
6bafb48 to
0a52363
Compare
ae9890d to
99d94e4
Compare
|
@mimugmail Thanks for the forwarder-specific observations. I have narrowed this PR to a single DoT/forwarder commit and addressed the two items below.
I also performed a migration check: restored the pre-development plugin, saved two legacy CSV forwarders, deployed this branch, and ran the normal model migration. Both entries became enabled plain-DNS rows with framework UUIDv4s, the legacy CSV was cleared, and the rendered |
99d94e4 to
90b5c21
Compare
DoT is working fine for me querying Cloudflare with the version of bind that comes with opnsense: v26.1.11_10. To configure DoT you need to add the following config to /usr/local/etc/namedb/named.conf.d/DoT_forwarders.conf: I have also copied in ca trusts to this folder although there is probably a better way to use the ca trusts already within opnsense. The last thing that is needed (and hence my PR #5588 ) is to add custom forwarders with the following syntax to the bind options: IMO I think both PRs are fine - being able to add TLS forwarders from the GUI would be great, and allowing custom bind options for edge cases would mean we don't need to write code for every bind option and can just let people manage the edge cases themselves. I guess I am just giving a simpler path to achieve DoT and also other custom config (There still seems to be a lot of changes for something that I would have thought would be simple - but I do find that with AI unfortunately). |
|
Good point on the opnsense version, I am slightly behind you, which may explain why your BIND DoT is working. Also, yes, I'm attempting to add a lot of work to get this stuff in the gui. In particular, like how unbound is set up in the gui. |
Important notices
If AI was used, please disclose:
Summary
BIND supports native DNS-over-TLS (DoT) forwarders, but the plugin previously exposed only a legacy comma-separated forwarder list. That format cannot represent a destination port or TLS hostname per forwarder.
This PR adds a dedicated Query Forwarding page with separate grids for plain DNS and DoT upstreams. Each forwarder has its own address and port; DoT forwarders may also specify a TLS hostname.
Behaviour
Scope
This PR is intentionally limited to forwarder configuration and DNS-over-TLS support. The unrelated DNSBL, dynamic DNS, reverse-zone, listener-interface, zone-NOTIFY, and UI restructuring work has been split into separate branches for follow-up PRs.
BIND compatibility
BIND 9.20.24 introduced an upstream regression that breaks DNS-over-TLS forwarders when BIND is configured with Forward Only. The fix is upstream in fb0ae8a5d6b2abb8b6ad3529e205caacbe4e70d1 and was released in BIND 9.20.26.
Users who need DoT with Forward Only should use BIND 9.20.26 or later.
Validation
example.com,cloudflare.com, andopenai.comreturnedNOERROR.Related issue
Closes #5546