celzero / rethink-app

DNS over HTTPS / DNS over Tor / DNSCrypt client, WireGuard proxifier, firewall, and connection tracker for Android.
https://rethinkfirewall.com/
Apache License 2.0
3.01k stars 153 forks source link

[Functional request] Add multiple HTTP(S)/SOCKS DNS and add routing functionality #1223

Open WhitePr opened 9 months ago

WhitePr commented 9 months ago

Please pardon my poor English

Multiple DNS outlets + routing. Currently there is only one DNS outlet and no routing function, for some websites using specific DNS will get better IPs. For example, in mainland China, using CloudFlare's DOH (https://1.0.0.1/dns-query) to query qq.com I get the IP from Hong Kong, but using AlibabaCloud's DOH ( https://223.5.5.5/dns-query) to get the IP from Guangdong, China

Multiple HTTP(S)/SOCKS outlets + routing. The current proxy simply returns the resolved IP to HTTP(S)/SOCKS, which can cause problems. Example. When using a browser to access a website, some websites don't need to go through a proxy but some do, but now there is only one proxy outlet and no routing, directly forwarding the resolved IP will cause all websites to go through the proxy, although it is possible to implement IP routing on the upstream proxy, but this method will fail if the website is using a CDN.

In summary I would like to add the following features. Add multiple DNS to allow different URLs to be queried using different DNS. Directly forward the accessed IP or URL to the upstream proxy, or add multiple proxy outlets and implement URL and IP routing within the application (make specific IPs and URLs go to specific proxy outlets).

ignoramous commented 9 months ago

these features make sense, but I doubt we'd implement them anytime soon.

It isn't that these could not be implemented, but that the UI starts to become complicated than it already is. Until we figure out a way to introduce power-user features such as per-domain / per-IP proxying, one is better off using actual proxifiers like SagerNet chained with Rethink's SOCKS5 forwarder (if possible).

Eollone commented 1 month ago

@ignoramous

This proposal certainly makes sense, I suggest we could start with a simpler implementation that addresses the core functionality of DNS routing based on application proxy status.

With the introduction of the "Advanced DNS filtering" feature, we can identify whether a DNS request comes from an app that requires a proxy or one that does not.