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

Custom providers for DoT #92

Open
spar01 opened this issue Oct 19, 2021 · 4 comments
Open

Custom providers for DoT #92

spar01 opened this issue Oct 19, 2021 · 4 comments

Comments

@spar01
Copy link

spar01 commented Oct 19, 2021

Would be great to have the ability to specify custom DoT providers

Opening an issue as a result of discussion in qdm12/gluetun#679

@qdm12
Copy link
Owner

qdm12 commented May 25, 2023

@AndrewKvalheim @spar01 @falahati

I'm finally working on this, but I'm a bit stuck on how one should input a custom provider.
For now the user specifies one or more CSV names like cloudflare,google and the program will fish out associated data for each. For example Cloudflare hardcoded data is:

func Cloudflare() Provider {

Now how should one input this data? I think keeping the CSV aspect to select multiple built-in providers is best, so maybe have another environment variable/input and the user should describe the provider for example with JSON?
A bit complex to do, it would be like DOT_PROVIDERS_CUSTOM={"name":"Cloudflare","dns":{"ipv4":["1.1.1.1","1.0.0.1"],"ipv6":["2606:4700:4700::1111","2606:4700:4700::1001"]},"dot":{"ipv4":["1.1.1.1","1.0.0.1"],"ipv6":["2606:4700:4700::1111","2606:4700:4700::1001"],"name":"cloudflare-dns.com","port":853},"doh":{"url":"https://cloudflare-dns.com/dns-query"}}. Obviously one can specify less IP addresses etc. but for example DoH requires both DoT + DNS, and DoT requires DNS ip addresses as well.

Thoughts?

@warrentc3
Copy link

Consider that a user may be leveraging Cloudflare Zero Trust and have a designated DoT/DoH URL given for their named location.

IMO, path of least resistance for a custom provider would fill all the boxes.

@AndrewKvalheim
Copy link

AndrewKvalheim commented Jun 1, 2023

This is probably a bad idea but I wonder if you could represent those as a flat list of URIs. Not sure if standards exists for all of it but RFC 4501 provides some precedent. Something like this would be simple to store in a single line CSV:

dns://1.1.1.1
dns://1.0.0.1
dns://[2606:4700:4700::1111]
dns://[2606:4700:4700::1001]
dot://1.1.1.1:853/cloudflare-dns.com
dot://1.0.0.1/cloudflare-dns.com # Default port can be omitted
dot://[2606:4700:4700::1111]/cloudflare-dns.com
dot://[2606:4700:4700::1001]/cloudflare-dns.com
https://cloudflare-dns.com/dns-query

@qdm12
Copy link
Owner

qdm12 commented Jul 12, 2023

Let's have all providers in a yml file. The program would output a yml file locally with its builtin providers if no file exists, and the user can then edit the file and restart the program to have additional providers. We can later on support other formats such as RFC 4501 / json / env variables.

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

No branches or pull requests

4 participants