Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbound needs certificate picker to serve DoT/DoH #8207

Open
FireStormOOO opened this issue Jan 11, 2025 · 7 comments
Open

Unbound needs certificate picker to serve DoT/DoH #8207

FireStormOOO opened this issue Jan 11, 2025 · 7 comments
Labels
support Community support

Comments

@FireStormOOO
Copy link

FireStormOOO commented Jan 11, 2025

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.
While Unbound supports serving DNS over TLS and DNS over HTTPS requests from clients, this requires setting a certificate for Unbound to use, and the web GUI is not exposing a certificate picker currently. This is the last missing feature for feature parity with pfsense's unbound wrapper. Note that this is distinct from the resolving behavior; this is unbound listening on 853 for clients using DNS over TLS.

Describe the solution you like

The Services > Unbound > General tab should provide a certificate picker that wires up a system certificate to unbound's tls-service-key and tls-service-pem options

Describe alternatives you considered

N/A; there's kinda just the one obvious implementation. I guess it could go on the Advanced tab instead.

Additional context

The equivalent setting on the pfsense side:
image

@fichtner fichtner added the support Community support label Jan 11, 2025
@fichtner
Copy link
Member

Just add the CA to System: Trust: Authorities. Self signed is also accepted there.

@FireStormOOO
Copy link
Author

Unbound resolving over TLS is working fine. I'm talking about having Unbound listen on 853 to clients using DNS over TLS

@fichtner
Copy link
Member

We don’t support this. It has been discussed a while back.

Cheers,
Franco

@FireStormOOO
Copy link
Author

#5104
#6558

Those are making this far more complicated than it needs to be. DoT just needs the cert provided AFAICT, and that seems to be the consensus in the above as well. Nothing else is trying to bind 853. I understand not wanting to deal with DoH since 443 is taken, and DoT is the better standard anyways.

I was mistaken with regards to what PFSense has - they went for only implementing DoT.

The use case is the same opportunistic encryption that DoT is for in the first place - yes, it requires client configuration to trust the specific DNS server for the network, but that's hardly a large ask in a managed environment. Failing that it's the same security profile as self-signed certs, better vanilla DNS, but only against passive eavesdropping.

DoH would be straightforward if it just had a requirement that it couldn't bind the same interface as web management. Alternately, it looks like it only needs the one /dns-query path, which could conceivably coexist with web management if they're using the same cert.

Is there any appetite for revisiting just DoT?

@maurice-w
Copy link
Member

@FireStormOOO You can do this with a simple custom include:

server:
  interface: 2001:db8:1234:53::1@853
  interface: 2001:db8:1234:53::1@443
  interface: 192.0.2.53@853
  interface: 192.0.2.53@443
  tls-service-key: "/var/etc/acme-client/keys/[...]/private.key"
  tls-service-pem: "/var/etc/acme-client/certs/[...]/fullchain.pem"

To avoid any conflicts with port 443, using an additional loopback interface is recommended. I've been running such a config for several years without any significant issues.

@gregtwallace
Copy link

gregtwallace commented Feb 21, 2025

To avoid any conflicts with port 443, using an additional loopback interface is recommended. I've been running such a config for several years without any significant issues.

Can you elaborate on the additional loopback interface setup? I was going to setup just DoT with a custom include but adding DoH as well if it isn't a pain would be nice. Thanks!

@maurice-w
Copy link
Member

'System: Settings: Administration', select the listen interface(s) which have the IP addresses you use for accessing the web GUI.
'Interfaces: Devices: Loopback', add an interface, assign it and configure static IP addresses.
In the Unbound settings, select this loopback interface. In the custom include, use the IP addresses of this loopback interface.
Configure these IP addresses as the DNS server in the DHCP and Router Advertisement settings.

Can also be done in the opposite way: Use a loopback interface for the web GUI and "real" interfaces for Unbound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Community support
Development

No branches or pull requests

4 participants