Last resort servers
Is your feature request related to a problem?
I have two domains, on the same server, proxied using cloudflare. This gives me a total of 6 proxy IPs and 1 real IP. Obviously connecting to the real IP is much faster than any proxy. Sometimes, the cloudflare IPs become so unstable with massive packet drops that they become useless. In such a situation I'd like to fallback to the real IP, but only as a last resort.
The crux of the problem is that I run my own VPN and DNS to bypass the Great Firewall of China. It's highly unlikely that cloudflare IPs will become blocked, but if the GFW sees a lot of traffic going to my actual IP, then it's at risk.
Describe the solution you'd like
I'd like to see an additional section in the config where I can list a set of servers which should be used ONLY if those listed in server_names ALL timeout/fail. I don't know exactly how this could be accomplished, but perhaps one of the last resort servers could be temporarily added to the main list for a given amount of time, then removed. If the main servers are still acting up then add again. Continuing in a cycle until the network eases up.
Alternatives you've considered
DNS over HTTPS is the only reliable solution for China users. Out of all the DoH clients I've tested so far, this is the only one that allows me to specify IP alongside domain name.
Who will that feature be useful to?
I think having a ranking system on the servers, other than latency, would be a benefit to everybody. Since the GFW is ramping up efforts to block DNS53 and DoT, you'll find a lot more China users looking for alternate solutions.
having a ranking system on the servers, other than latency
The latency here is calculated until got an answer from the server or timeout.
So, if you have listed all your IPs in static servers or your own sources, the good one would be bubbled to top with low latency on the fly. That's the logic. I'm not sure "try bad ones first" is a good idea.
the good one would be bubbled to top with low latency on the fly. That's the logic. I'm not sure "try bad ones first" is a good idea.
Let me put it another way, say I have 3 public servers listed but I also own a private server for which I have to pay bandwidth. I'd prefer to use those servers which don't cost me anything until absolutely necessary.
I need this feature, too. My own DNS server outperforms all others I have tested (which is a bit weird, as it is not particularly near me), but if I only use it, when it is down, I'll be in deep trouble. If I use other servers, it will take quite a time for dnscrypt to use my own server (as its RTT is not good), and it will also continue to only use it half the time because of the load balancing.
PS: The OP's reason is also very valid. I don't understand why you're so flippant about it.
@twifty Why is it that Cloudflare IPs become unstable? Is it a Cloudflare thing or a GFW thing?
@batbone The Cloudflare IP's usually become unstable between about 9pm and 2am local time, so I'm guessing it's a congestion issue. It makes you wonder just how many people in China are actually using cloudflare to circumvent the GFW.
As a workaround to this issue, I'm looking into running a second dnscrypt-proxy instance and have dnsmasq use it as a failover. TBH though, dnscrypt-proxy should handle this and I shouldn't even need to have dnsmaq installed at all.
Didn't satisfy your request isn't 'flippant'! Take it easy. I'm just a volunteer trying to help answer some questions. Be polite!