mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #43] Split trust-dns into multiple crates #29
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bluejekyll on GitHub (Sep 1, 2016).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/43
move the repo into this format over time:
trust-dns/trust-dns-core/- record serialization, no networking, etc.trust-dns/trust-dns-client/- futures impl of all lookup logic, optionally compile in DNSSec, etc.trust-dns/trust-dns-server/- authority implementations, dependency on SQLLite here, etc.trust-dns/trust-dns-cache/- LRU caching layer that can wrap the client, aka resolver?edit: I realized that changing the
trust-dnscrate name would orphan the existing library in crates.io. My plan right now is to maintain that name for the client library, but fork out the server library.@rushmorem commented on GitHub (Oct 5, 2016):
How about just
trust-dns/core,trust-dns/cliente.t.c? I don't know but to me it looks cleaner without the repetition. The crate name can always be overridden inCargo.tomlanyway. Also what do you think about grabbing thetrust-dnsGithub organisation name while you are at it? Having said that, thanks a lot for all your work on this. I look forward to using your DNS library in our apps.@bluejekyll commented on GitHub (Oct 5, 2016):
This is a great suggestion. I mostly opened this to capture the intention to do this. I'm working on the change right now, so seems like a good time to do it.
I might drop the
coreand instead just do theserverandclient.As to the crate names, I'm planning on
trust-dnsfor client andtrust-dns-server, with a futuretrust-dns-cacheedit: updated client, it will maintain the
trust-dnslibrary name.@rushmorem commented on GitHub (Oct 5, 2016):
When I first started checking out Rust, a DNS library was one of the things I was interested in. Our apps are currently written in Go. We run a custom DNS server utilizing
miekg's awesome library. We also use the same library in some of our other services that are not DNS servers, to lookup DNS records.At first, and for quite a while at that, I thought
trust-dnswas just a binary. It was only recently that I realized we can use it as a library to perform DNS queries. It's still not clear to me though how we can use use it to build a custom server or extend it fetch the DNS records from other sources.@bluejekyll commented on GitHub (Oct 5, 2016):
I'm not familiar with that. Can you describe some of the features you like in that? I'd be happy to look at supporting some of them.
I'm not sure exactly what you mean by this. In the next release I'm going to have native support for futures.rs and the Tokio application framework. This should allow for easy integration into Rust libraries built on the same architecture.
Here are some examples of using that:
github.com/bluejekyll/trust-dns@85c6b8ebe7/src/client/client_future.rs (L788)I'm not sure when I'll get this release out at the moment, but probably in the next few weeks for the client impls.
As to the Server, I haven't started on the futures impl, for that yet, but again, I have some tests which show how to create a server, and stick stuff into the Authority:
github.com/bluejekyll/trust-dns@85c6b8ebe7/src/server/server.rs (L518)But expect a lot of that to change in a little bit as I move to futures. I have been thinking of building in dynamic library loading to support custom resource record evaluation or other such plugins.
@rushmorem commented on GitHub (Oct 5, 2016):
I was referring to this library. It's the go to DNS library in Go whether you are writing DNS servers or DNS clients. What I like about it is that it makes no assumptions about what you will be using it for. It just exposes an API you can use and gets out of your way.
It's modeled around Go's standard
net/httplibrary. Think of it as hyper for DNS.We run a cluster of servers across two datacenters. We store our DNS records in a distributed database. We also have some unique features that are not available in standard DNS servers to cater to our market's needs.
When a DNS request comes in, the library (which comes with a builtin server by the way) parses it and forwards the DNS message to our handler as a normal Go type. We then process it and pass a DNS message back.
Yes, I noticed your work on implementing futures.rs. This is exciting to say the least. Once again, thanks for this.
@bluejekyll commented on GitHub (Oct 5, 2016):
When I started this, it wasn't an intention of mine to create a library like this, more to write a full server implementation. I can definitely work on making portions of the library more flexible and componentized as necessary.
Ok, I totally understand what you want. We can file another issue for that. I do have a structure for Messages of that form (I need to clean up the docs):
https://docs.rs/trust-dns/0.7.3/trust_dns/op/message/struct.Message.html
And then you want a pluggable trait interface for the backing Catalog/Authority:
https://docs.rs/trust-dns/0.7.3/trust_dns/authority/struct.Catalog.html
https://docs.rs/trust-dns/0.7.3/trust_dns/authority/struct.Authority.html
Which you could use to read/write to the distributed db. I don't have a generic trait for those right now or a way to swap out the implementations, but it should be easy to make that possible.
@rushmorem commented on GitHub (Oct 5, 2016):
Yes I realize this. You mostly market it as such which is what gave me my initial impression. I think something like this would roughly equate to the
trust-dns/corecrate that you are thinking of dropping. I hope I can persuade you to reconsider. You can always implement your full blown DNS server on top of that library as a separate crate, perhapstrust-dns/server.The guy who made that Go library has a full blown DNS server too called CoreDNS. It's not only a DNS server, it's also a load balancer. We use it too for exactly that capability. Our custom DNS servers are actually sitting in the background as back-ends. I think this is pretty neat as there are not many load balancers for UDP out there.
@rushmorem commented on GitHub (Oct 5, 2016):
I have filed a separate issue. Thanks for the pointers. I will dig into those structs and traits.
@bluejekyll commented on GitHub (Nov 6, 2016):
Ok, I've gone with this strategy
trust-dns/client==trust-dns(crate)trust-dns/server==trust-dns-server(crate)I'm not currently planning on any others at the moment... there will probably be a resolver in not too long, but that's a separate task.