Skip to content

Conversation

garmr-ulfr
Copy link
Contributor

This pull request introduces support for multiple DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) resolvers in the common/httpclient.go file, replacing the previous single-resolver approach. It also includes a new test suite to validate the functionality of these resolvers.

Enhancements to DNS Resolver Functionality:

  • Support for Multiple Resolvers: Added lists of predefined DoH and DoT resolvers (dohResolvers and dotResolvers) to enable the creation of multiple DNS tunnels. (common/httpclient.go, common/httpclient.goR43-R64)
  • Refactored newDNSTT to newDNSTTs: The function now initializes multiple DNSTT instances using all resolvers in the lists, instead of a single instance based on a single resolver. (common/httpclient.go, [1] [2]
  • Updated HTTP Client Initialization: Modified GetHTTPClient to integrate multiple DNS tunnels into the HTTP client configuration. (common/httpclient.go, common/httpclient.goL100-R128)

Testing Improvements:

  • New Test Suite: Added TestDNSResolvers in common/httpclient_test.go to validate each DoH/DoT provider.

@garmr-ulfr garmr-ulfr requested a review from Copilot July 24, 2025 23:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the DNS tunneling functionality by introducing support for multiple DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) resolvers, replacing the previous single-resolver approach with predefined resolver lists to enable creation of multiple DNS tunnels.

  • Adds predefined lists of DoH and DoT resolvers for redundancy and load distribution
  • Refactors newDNSTT to newDNSTTs to create multiple DNSTT instances
  • Updates HTTP client initialization to integrate multiple DNS tunnels

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
common/httpclient.go Adds resolver lists, refactors DNS tunnel creation to support multiple instances, and updates HTTP client configuration
common/httpclient_test.go Introduces test suite to validate DoH/DoT resolver functionality
Comments suppressed due to low confidence (1)

common/httpclient_test.go:36

  • The error message incorrectly states 'DNS over TLS resolvers' when this is testing DoH resolvers. It should say 'All DNS over HTTPS resolvers failed'.
		assert.Empty(t, failed, "All DNS over TLS resolvers failed")

@WendelHime
Copy link
Contributor

@garmr-ulfr sorry, I just noticed that I forgot to review this PR! Do we still want to merge it? Kindling already receives a list of DNS servers that should be used by the smart dialer, shouldn't we use the same list here?

@garmr-ulfr
Copy link
Contributor Author

@WendelHime, honestly, I forgot about this too 😆.

Kindling already receives a list of DNS servers that should be used by the smart dialer, shouldn't we use the same list here?

I'm not sure, but, since we'll be moving away from flashlight completely soon, I don't think it really matters.

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