Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Asynchronous DNS support example #2

Open
inejge opened this issue Dec 15, 2016 · 3 comments
Open

Asynchronous DNS support example #2

inejge opened this issue Dec 15, 2016 · 3 comments

Comments

@inejge
Copy link
Contributor

inejge commented Dec 15, 2016

Since the first version of tokio-socks5, a couple of futures-based DNS crates appeared, and an example of using one of them for name resolution ought to be helpful as a demonstration of integrating disparate futures-based code bases.

I've adapted the code to use @bluejekyll's TRust-DNS library (with his generous help; thanks!) and would like to open a PR, but since the thread-pool resolver example is valuable, I'd prefer to base the PR on a different branch (the README in master could be updated to announce its existence). Do you agree with that approach, and if so, could you create a new branch?

@alexcrichton
Copy link
Contributor

Awesome news!

I'd prefer to keep everything on one branch (tough to remember to update various branches over time). On one hand using a thread pool is a great time to show off an easy way to make blocking work asynchronous, but on the other hand I'd also want to show off true asynchronous DNS solutions in tokio.

I think it's probably best, though, to show of asynchronous DNS solutions, so let's just go ahead and switch over to using TRust-DNS entirely. Want to send a PR for that?

@bluejekyll
Copy link
Member

Just an FYI. This implementation looks fine for a basic IPv4 DNS requests which rely on the upstream resolver to handle CNAME lookups, etc. I do want to add a complete resolver at some point to the DNS library, that's probably after some updates to the DNSSec stuff. That will handle CNAME chain lookups along with IPv6 and fallback to IPv4. I'll let you know when that's ready so that you could integrate that in the future as well.

@inejge
Copy link
Contributor Author

inejge commented Dec 16, 2016

I think it's probably best, though, to show of asynchronous DNS solutions, so let's just go ahead and switch over to using TRust-DNS entirely. Want to send a PR for that?

@alexcrichton Sure, I've opened #3.

@bluejekyll Yes, the implementation is very basic, and I've updated the comments to reflect the fact. Having a fully-fleshed resolver would be wonderful, of course, and I'll try to help with writing one, if time permits.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants