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

Create DNS resolve tool #102

Merged
merged 3 commits into from
Oct 16, 2023
Merged

Create DNS resolve tool #102

merged 3 commits into from
Oct 16, 2023

Conversation

fortuna
Copy link
Contributor

@fortuna fortuna commented Oct 13, 2023

This helps me test things in remote proxies. See the README.

Usage: resolve [flags...] <domain>
-resolver string
The address of the recursive DNS resolver to use in host:port format. If the port is missing, it's assumed to be 53
-tcp
Copy link
Contributor

@daniellacosse daniellacosse Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any instances where-tcp wouldn't make sense? Like if we were to add DoH, would this become redundant? I only ask because maybe a better interface would be some kind of enum, so users can't pass in ambiguous states like -tcp -https for example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, -tcp wouldn't make sense for DoH/DoT. However, for now I'm just considering standard DNS.

I'm building up to something that can support multiple solutions. I'm trying to do it in a way that we can reuse the standard Resolver, so we can piggyback on the standard Dialer (which takes a Resolver). I'm not sure we can use DoH and reuse the standard Dialer, because Resolver is not that configurable, so we may need to reimplement a lot of the Dialer logic to use DoH.

For now, I've decided to punt on those complexities and stick to standard DNS, and we can revisit in a following step.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll note, however, that this implementation supports DoT if we force TCP and add a TLS transport that allows us to set the alpn to dot, since the plaintext wire format is the same as DNS over TCP.

Copy link
Contributor

@daniellacosse daniellacosse Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so basically whatever supports DoH would effectively wrap this (as the scope is standard DNS), making my concern that the interface here could later break a non-issue.

x/examples/resolve/main.go Outdated Show resolved Hide resolved
@fortuna fortuna merged commit 72410f3 into main Oct 16, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants