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

send request to all upstream servers #167

Open
zhaibin18 opened this issue Feb 22, 2020 · 5 comments
Open

send request to all upstream servers #167

zhaibin18 opened this issue Feb 22, 2020 · 5 comments
Assignees

Comments

@zhaibin18
Copy link

zhaibin18 commented Feb 22, 2020

I have the forward-zone config like this:
forward-zone:
name: "."
forward-addr: 8.8.8.8
forward-addr: 9.9.9.9

I hope unbound will send all dns request to 8.8.8.8 and 9.9.9.9, then return the first answer to the client.

In dnsmasq with all-servers config
--all-servers
By default, when dnsmasq has more than one upstream server available, it will send queries to just one server. Setting this flag forces dnsmasq to send all queries to all available servers. The reply from the server which answers first will be returned to the original requester.

@zhaibin18 zhaibin18 changed the title send all request to upstream servers send request to all upstream servers Feb 24, 2020
@ralphdolmans ralphdolmans self-assigned this Feb 24, 2020
@ralphdolmans
Copy link
Contributor

Hi,

I am reluctant to implement such functionality, as this will generate way more traffic than needed.

Right now Unbound uses the same algorithm to select a forwarder as when sending queries upstream. Unbound will, over time, learn how responsive an upstream is. It will randomly select from all servers that are not more than 400ms away from the fastest. Details about that can be found at https://nlnetlabs.nl/documentation/unbound/info-timeout/

For anycasted servers like the ones you are using, they will probably both be in the 400ms RTT band, meaning they will both be used. Note that the default upstream selection algorithm can be adjusted using the fast-server-permil and fast-server-num configuration options.

@zhaibin18
Copy link
Author

zhaibin18 commented Feb 24, 2020

Hi,

I am reluctant to implement such functionality, as this will generate way more traffic than needed.

Right now Unbound uses the same algorithm to select a forwarder as when sending queries upstream. Unbound will, over time, learn how responsive an upstream is. It will randomly select from all servers that are not more than 400ms away from the fastest. Details about that can be found at https://nlnetlabs.nl/documentation/unbound/info-timeout/

For anycasted servers like the ones you are using, they will probably both be in the 400ms RTT band, meaning they will both be used. Note that the default upstream selection algorithm can be adjusted using the fast-server-permil and fast-server-num configuration options.

Many thanks to your reply,in my config 8.8.8.8 and 9.9.9.9 are some examples, The DNS server from my ISP grow up to 3s for response sometimes,So please add an options for sending DNS request to all upstream servers and use the first reply immediately.

@ralphdolmans
Copy link
Contributor

But in that case the 400ms RTT banding should be fine, right? Unbound will see that one of the upstreams is more than 400msec slower than the fastest upstream, and therefore eventually exclude it from the server selection for some time.

@zhaibin18
Copy link
Author

zhaibin18 commented Mar 14, 2020

compare with smartdns(https://github.com/pymumu/smartdns), the unbound response time is 7-8 ms and smartdns response time is 2-3 ms with same upstream dns server.

@LittleGrocery
Copy link

compare with smartdns(https://github.com/pymumu/smartdns), the unbound response time is 7-8 ms and smartdns response time is 2-3 ms with same upstream dns server.

Since you already know smartdns, I think you can assemble your own dns server likes below(if your operating system is Linux or win10):

DNS query process:your computer→smartdns→unbound

→mainland china address whitelist→your isp dns server

→other address→dnscrypt proxy(doh)(socks or HTTP proxy already support if you need)→self-define doh server

I think this can tremendously improve your experience of web surfing.

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

No branches or pull requests

3 participants