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
2.98k stars 149 forks source link

Fallback DNS for local IP(s) #1745

Open aviv926 opened 1 week ago

aviv926 commented 1 week ago

I use Nextdns in order to rewrite my server address when I'm at home to a private address, that is, mysite.example.com has become 192.168.1.2 with a port forwarded (through the router) to the requested service which also appears public at the same address (mysite.example.com)

The thing is, when I'm out of the house, the address 192.168.1.2 is not available of course, so I would expect that when for several attempts to locate 192.168.1.2 by the main DNS server without success, the Fallback DNS will come into effect in order to retrieve the true address of the server.

what do you think Is it applicable? Will there be in-app support for cases of self-hosting and moving between different networks? For example, make Rethink behave in an X way when connected to a WIFI network / a specific WIFI network and in a Y way when operating on cellular networks.

ignoramous commented 1 week ago

I use Nextdns in order to rewrite my server address when I'm at home to a private address

NextDNS setup at the router? If so, System DNS should use NextDNS when you're connected to that router. Is that not what you see happen?

Will there be in-app support for cases of self-hosting and moving between different networks?

It wouldn't take us long to implement this, but the UI / UX is already a nightmare and adding more knobs is only adding more clutter.

Possible duplicate?

See also:

aviv926 commented 1 week ago

NextDNS setup at the router? If so, System DNS should use NextDNS when you're connected to that router. Is that not what you see happen?

No, I use NextDns in DoH with a customized profile in Rethink, so automatically the DNS of the router is not relevant in this case, so I would expect Fallback DNS to come into action and find the IP address of the server when I am not in my home network.

It wouldn't take us long to implement this, but the UI / UX is already a nightmare and adding more knobs is only adding more clutter.

That's good to hear, I hope it arrives, when it arrives... Thanks for the hard work you put into this project!

Possible duplicate?

See also:

wgtunnel sounds like a great option the problem is that it also needs to create a VPN connection but then Rethink won't be used (which is not something I want) I hope one day there will be a union between them or a merger of features from wgtunnel to Rethink.

aviv926 commented 1 week ago

@ignoramous Do you think it's a problem that Fallback DNS doesn't try to resolve the domain in the scenario I wrote?

ignoramous commented 1 week ago

Do you think it's a problem that Fallback DNS doesn't ...

  1. Fallback DNS is not used when the actual user-preferred DNS is selected, even if unresponsive.
  2. Fallback DNS is also a "bootstrap" helping resolve IPs of DoH/DoT/ODoH resolvers.
  3. Fallback DNS is also used by Rethink for its own DNS (especially when in Loopback mode).
aviv926 commented 1 week ago

Do you think it's a problem that Fallback DNS doesn't ...

  1. Fallback DNS is not used when the actual user-preferred DNS is selected, even if unresponsive.
  2. Fallback DNS is also a "bootstrap" helping resolve IPs of DoH/DoT/ODoH resolvers.
  3. Fallback DNS is also used by Rethink for its own DNS (especially when in Loopback mode).

Oh I see, actually as it is called I was sure it is used when the DNS selected by the user does not return an "answer" or when it is an unavailable address - a private address (if it is possible to make this happen understand when it was able to decode a private address and when the address is private Not available (due to mobile data) Do you think this will be supported in future versions?

ignoramous commented 1 week ago

Switching DNSes based on mobile / wifi networks is tracked at #1130

Do you think this will be supported in future versions?

Not this specific usecase but #1130 will be.