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

Add support for DNS resolution on non-port 53 to DnsDiscovery #2342

Closed
zh522130 opened this issue Jun 4, 2024 · 8 comments
Closed

Add support for DNS resolution on non-port 53 to DnsDiscovery #2342

zh522130 opened this issue Jun 4, 2024 · 8 comments
Labels

Comments

@zh522130
Copy link
Contributor

zh522130 commented Jun 4, 2024

I do have this need because my port 53 is required for other DNS services. Currently, I have modified the code locally and validated it. If others have a similar need, I can submit a PR.

@zh522130
Copy link
Contributor Author

zh522130 commented Jun 4, 2024

This is not an issue; I just want to confirm whether I should submit this PR.

@dignifiedquire
Copy link
Contributor

which part of the code are you talking about, iroh-dns-server?

@zh522130
Copy link
Contributor Author

zh522130 commented Jun 4, 2024

which part of the code are you talking about, iroh-dns-server?

yes

@dignifiedquire
Copy link
Contributor

sure, a PR would be appreciated

@zh522130 zh522130 changed the title Running DNS services on non-53 ports Add support for DNS resolution on non-port 53 to DnsDiscovery Jun 4, 2024
@zh522130
Copy link
Contributor Author

zh522130 commented Jun 4, 2024

There was an issue with my previous description. The actual situation is that the iroh-dns-server can run on non-port 53, but DnsDiscovery does not support resolution on non-port 53. so this is related to iroh-net

@flub
Copy link
Contributor

flub commented Jun 5, 2024

I think this is already possible with iroh_net::endpoint::Builder::dns_resolver: it allows you to construct your own resolver client that the endpoint will use, including the DnsDiscovery feature. You'd use something like hickory_resolver::config::ResolverConfig::add_name_server to set custom connection details for your DNS server.

@zh522130
Copy link
Contributor Author

zh522130 commented Jun 5, 2024

I think this is already possible with iroh_net::endpoint::Builder::dns_resolver: it allows you to construct your own resolver client that the endpoint will use, including the DnsDiscovery feature. You'd use something like hickory_resolver::config::ResolverConfig::add_name_server to set custom connection details for your DNS server.

I have previously tested the dns_resolver, and the main issue is that the relay also uses dns_resolver, which cannot resolve the relay address. It's possible that I'm using it incorrectly, I will continue to research this. Once the tests pass, I'll close this issue.

@zh522130
Copy link
Contributor Author

zh522130 commented Jun 6, 2024

@flub Thank you. I've implemented custom port resolution through dns_resolver.

Should anyone need it, you can refer to the create_default_resolver function in dns.rs. You simply need to add a DNS service with a custom port using config.add_name_server().

@zh522130 zh522130 closed this as completed Jun 6, 2024
@github-project-automation github-project-automation bot moved this to ✅ Done in iroh Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants