How to query 2 DNS servers simultaneously and use the first IP that comes back
-
Is it possible to query 2 DNS servers simultaneously and use the first IP that comes back? Ie the query goes to both servers and depending on traffic one of the replies comes first and the IP in it is the one used?
-
I don't think so. While a device may have more than one DNS configured, it tries the first and if that fails, tries the next. However, it may be possible if the DNS servers have an anycast address, as is available on IPv6.
-
Just found this but not sure I understand what he is refering to. Is there a package that does the job?
https://serverfault.com/questions/732920/how-to-do-parallel-queries-to-the-upstream-dns-using-unbound
-
The forwarder is still there : it's dnsmasq.
The default resolver is Resolver (unbound), so switch from Resolver to Forwarder, and you will be using dnsmasq.
If it still is requesting all DNS servers at ones, that I don't know. -
The forwarder does this out of the box - it will query all your ns listed not just 2.. So if you have 4 all of them will be queried at same time and the first response will be used. Unless you enable sequential queries that is how the forwarder works.
Why would you need to do that though? Your going to shave off a few ms at best.