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

More flexible StubResolver queries #147

Open
jeromegn opened this issue Sep 17, 2022 · 1 comment
Open

More flexible StubResolver queries #147

jeromegn opened this issue Sep 17, 2022 · 1 comment

Comments

@jeromegn
Copy link

For our use case, we're forwarding some requests to an unbound server running on our hosts.

The StubResolver doesn't quite work for us because:

  • There's no way to send it a Message as the query, only a impl Question, therefore the response's id won't match our request's id.
  • We can't directly modify the returned Message (from Answer::into_message) because the underlying Octets are Bytes which aren't mutable.

We presently work around this by writing the answer's bytes to a BytesMut, then using that as a Message's backing Octets and then modifying the header to set the original request's id.

Would it be desirable to add a function to make a DNS request via a full Message instead of just impl Question?

If not, then maybe a query_mut function to receive an Answer that can be converted to a Message<BytesMut>.

@partim
Copy link
Member

partim commented Sep 19, 2022

The original intention for the stub resolver was to be a driver for the more complex logic implemented by the lookups. Allowing you to do your own raw query was a bit of a side effect. Since that seems to be one of the main uses now, it might be time to reconsider.

We have a plan to separate out the transport implementations into their own modules. This might be a good time to rethink the whole concept.

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

No branches or pull requests

2 participants