Skip to content

[Feature Request] Upstream failover and Upstream IP. #100

@twifty

Description

@twifty

I run doh-server on my server under two domains. My server is proxied by cloudflare, so I have 3 IPs for each domain, plus the servers real IP address.

I've configured doh-client locally with the two domains, and added the six cloudflare IPs to my /etc/hosts file. Now, here is the problem. Sometimes, a cloudflare IP will become unstable with massive packet drops, causing the doh-client to timeout and return an empty response. We need the client to try again with either a different upstream or a different IP (if one exists) for the same domain.

I suggest adding the ability to specify the upstream IP address alongside the domain, thus eliminating the need to add them to the hosts file. This should allow us to add multiple entries for the same domain. In addition, when the first query fails I'd like to see a failover to the next upstream server. A maximum_failover setting could be introduced and/or an individual upstream timeout (with the current timeout setting acting as a global timeout).

Please note, I live in China which has recently blocked all DNS-over-TLS. Regular DNS53 IPs get blocked for a short time if I query banned domains (youtube/facebook etc). I cannot risk using my servers real IP, and must proxy it with cloudfare, out of the chance it will get blocked by the GFW. Currently dns-over-https is the only software I've found that actually works. But every time one of my IPs becomes unstable I have to edit the hosts file and restart services.

I would offer a pull request myself, but I unfortunately know nothing about the GO language.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions