systemd / systemd

The systemd System and Service Manager
https://systemd.io
GNU General Public License v2.0
13.23k stars 3.78k forks source link

[systemd-resolved] Add option to send query to all nameservers in parallel #14159

Open tmccombs opened 4 years ago

tmccombs commented 4 years ago

Is your feature request related to a problem? Please describe. I have multiple dns nameservers for redundency and want to minimize latency if one of the nameservers becomes unavailable.

Describe the solution you'd like I would like an option to tell systemd-resolved to send queries in parallel to all configured nameservers and use the first response that is returned. Thus if the first nameserver fails to respond, the client will still get a response quickly.

Describe alternatives you've considered My current solution is using dnsmasq with the all-servers option enabled. However, if this feature was supported, then I wouldn't need dnsmasq and could just use systemd-resolved.

monperrus commented 4 years ago

related issue: #13925

Hoeze commented 1 year ago

We constantly run into this issue. We have two DNS servers in our network but as soon as one goes offline, half of our clients get unresponsive.

wschlich commented 1 year ago

Yes, this behavior of systemd-resolved really sucks compared to dnsmasq with the all-servers option.

Hoeze commented 1 year ago

Hi @keszybz, is there any way to solve this issue?

poettering commented 1 year ago

you can "hack" this, by adding a dummy interface for each dns server, then assigning one DNS server to each dummy interface.

There's little stopping us from allowing multiple sets of dns servers per interface and globally (i.e. additional "scopes" as we call them internally in resolved), but noone hacked this up so far. Happy to review a patch for that.

Hoeze commented 1 year ago

@poettering Thanks a lot for your reply! Do you maybe have some hints on how to implement this? I found the resolved sources, but I do not really see where the actual request gets triggered.

tmccombs commented 1 year ago

Unfortunately, I haven't been able to set up a workaround using dummy interfaces. See https://github.com/systemd/systemd/issues/5573#issuecomment-1066469885 and https://github.com/systemd/systemd/issues/20485#issuecomment-1022067933.

Perhaps there should be a separate issue for addressing that?

rpigott commented 7 months ago

This is really subset of #5573. Implementing that would also solve #20485.

@tmccombs yeah that's probably worth a new issue. sd-resolved should work on such interfaces, even if the above were implemented.