-
Notifications
You must be signed in to change notification settings - Fork 282
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
OPNSense package #535
Comments
Interesting idea - can you provide any more details? Are you a maintainer/contributor to opnsense or know someone? Anyone can join or telegram group: https://t.me/hns_tech or IRC #handshake and we can discuss further. We desperately need more contributors to the Handshake project -- not sure how long it will be before someone has spare cycles for this integration. |
I'm unfortunately not involved with opnsense packaging, but I'm also involved with a mesh networking project that is interested in running handshake resolution on each mesh node so that users of the mesh don't have to rely on access to the clearnet. I realize now that it may make more sense for this issue to be on the hnsd repo, since that would be more suited to embedded devices. The one caveat I can see is that it's unclear how handshake can integrate into an existing unbound config - the readme in this repo hints at being able to supplement a running unbound daemon with handshake capabilities, but so far I have only been able to get hsd and hnsd to act as a non-forwarding standalone resolver, which isn't as helpful since I need unbound to only redirect handshake domains to hsd/hnsd and still recursively resolve regular domains. Beyond that, it should be pretty straightforward for anyone familiar with packaging. I know someone who may have time for an openwrt package, but I was hoping on testing such a setup locally with my opnsense router before adding it to our mesh node builds. I'm just wary of installing stuff outside of the opnsense package manager since I think the appliance-os nature of opnsense may blow away any added stuff when updating. |
hsd and hnsd both implement two resolvers: an authoritative nameserver over the HNS root zone, and a recursive resolver. The recursive resolver always tries to resolve against the HNS root zone first. If the TLD in the query is not present in the HNS root zone, the recursive resolver starts over using the ICANN root zone. In this sense, the HNS resolvers "fall back" to the ICANN root. Until there is a collision between the two namespaces, this means that users can install HNS resolvers and go about all their normal DNS without interruption (and even perhaps an additional boost in privacy since they are no longer using 1.1.1.1 or whatever). These users can also of course begin to resolve HNS names. hsd and hnsd both use the I understand if an application wants to do this process in reverse ie. check ICANN root first and then try HNS root if that fails, and this is easy to configure. In addition, the HNS resolvers can be used just for their authoritative root zone name servers and integrate that way into any existing DNS resolver as a plugin. |
Gotcha, in that case it sounds like the appropriate solution for a router is to replace unbound with hnsd, since it sounds like you are saying that hsd can't be implemented in a way where lan devices can resolve both icann root and handshake. Do you have a resource on how to configure the reverse order for hnsd? I don't see any mention of that feature in the hnsd repo. I would also want the ability to specify upstream dns since our mesh nodes may need to prefer other alternate roots in the future (such as opennic). Also, I realize I misspoke - the openwrt base I'm working with is using dnsmasq for dns, but I think if I can configure hnsd as above with the reverse order and a custom upstream dns server, then I can just direct it to pass all dns to hnsd. |
DNS forwarding is possible by configuring unbound (see handshake-org/hnsd#46) but I haven't experimented with this myself. And to be clear, both hsd and hnsd WILL resolve all ICANN-rooted domains, but ONLY if the TLD is not found in the HNS root. I have been using HNS resolvers all year without any disruption in my internet connection or name resolution, plus I get the added benefit of HNS domains. There is currently no way to configure the priority of the resolvers root zones, it's hard coded in hnsd here and in hsd here also, both hsd and hnsd run authoritative name servers over the HNS root that are accessible on separate ports, so you can bypass the built in recursive resolvers altogether without any special configuration. |
Thanks that's very useful - I didn't notice that config parameter before. The problem I'm having now is that it seems I can't resolve hns domains. The forwarding seems to work fine which I've set with this unbound config:
Maybe I just need examples of hns domains with A records - I tried Authoritative mode might come in handy if I set up unbound / dnsmasq to retry failed lookups with hnsd. I'll look at that at a later date. |
What resolver is running at You might find this suggestion uesful in the other thread: handshake-org/hnsd#46 (comment) I'm not sure a better way to deal with this yet. |
@pinheadmz I thought that hnsd was supposed to try hns domains before using legacy dns? 192.168.1.1 is indeed a legacy resolver, but I am trying to use the behavior you mentioned earlier to my advantage: Does that not hold true when using forward-addr? I even tried adding forward-first: no but that seems to not help. This seems like it would be a bug in hnsd if the resolve order doesn't respect forward-addr |
hm I havent played with the forwarding myself but it sounds like its forwarding |
Yep that seems to be the case. That bash script is clever for a workaround but for packaging purposes I'm hoping to find a config that uses hsd/hnsd's knowledge of which domains belong to hns. I'm really unsure if this is working properly in the first place - simply running
But I can't browse to welcome.nb, sci-hub.hns, handshake., etc. I just realized that I can load welcome.nb through welcome.nb.hns.to, so I think something must be wrong with my setup. |
Hm, I just ran hnsd with default parameters, waited for it to sync to height Meanwhile - what are you trying to do with the forwarding? (sorry). By default hnsd and hsd will resolve ICANN and HNS names, with HNS being the priority. Are you trying to set it up so that ICANN is the priority? Or configure so that the HNS root isn't even checked unless you're sure an HNS name is being requested?
|
Oddly enough, running
The use case I am trying to solve is if an end user would like to use a custom DNS server for various reasons - it could be the DNS filtering features of various public DNS servers, or a non-icann root such as opennic, or maybe they want to (we would configure it for them) use the DNS provided by their gateway VPN to avoid DNS leaks. Our mesh nodes could also lack clearnet access, so the icann resolver would fail if gatewaying out of the mesh isn't configured. Crucially, we want to retain the flexibility to use in-mesh DNS if necessary (via 200::/7 ipv6 mesh addresses). I plan on adding hnsd to openwrt builds that end users will be using, and I don't want to explain to laypeople why they have to choose between being able to visit handshake websites and using a custom DNS server. Most people expect to be able to go to their router settings and paste an IP address to use, and that's essentially how the current DNS settings work. Being able to re-order the priority would be a nice to have, but the crux of the situation is that we want to be able to use a custom upstream server for various reasons - traditional DNS may not be accessible or the user may want a specific DNS server for particular features, and it feels pretty dirty to do a hack like that bash script in something an end user will be using (especially since it requires clearnet access to get the list of TLDs). Edit: I also tried building the latest master branch of hnsd and still got the same result. Is it normal to get a bunch of "unknown command: 6"? |
Don't worry about this - hnsd only recognizes a few of the p2p protocol messages used by hsd. I think |
Anyway your use case of "only query HNS when we know it's an HNS name" has come up in other contexts as well. For a different project we're discussing using a bloom filter or some other sort of compact list to determine is a TLS is in the HNS root zone or not. Another option is to add this kind of feature to hsd (the full node) and perhaps enable a "root zone dump" file to be committed in the block headers so the entire zone file can be delivered regularly and trusted by light clients. |
@pinheadmz The order of query is actually pretty minor to me, the real gamebreaker for me is the fact that the upstream forward zone gets all HNS queries too. I figured out that my issue is caused by all DNS on my network being redirected, which could easily be the case for one of our mesh devices as well (for example if it was connected to the internet through a public hotspot that redirects all DNS to a custom server in order to display a captive portal). It seems to me that the ideal solution would be to change the behavior of hnsd to only forward queries to the unbound config defined For example, an This imo would make it easier to setup handshake network-wide and not require handling or updating root dumps. |
Ok great --- could you open a specific issue for this? Sounds good as a solution |
Sure, I'll open one on the hnsd repo. Also this issue could be closed since I really intended to open this on hnsd. |
Thanks @stephen304 ! Continuing discussion on handshake-org/hnsd#53 |
It would be great if you guys could package hsd for opnsense, which would make it super easy to add handshake resolving support to unbound network-wide.
The text was updated successfully, but these errors were encountered: