2 ms·
I think you have the pieces all jumbled. Every tool still uses gethostbyname which uses the glibc NSS machinery. The only thing systemd did was add a few NSS mo
by Spivak 5y ago
I think you have the pieces all jumbled. Every tool still uses gethostbyname which uses the glibc NSS machinery. The only thing systemd did was add a few NSS modules that could (and are) configured in /etc/nsswitch.conf. You probably have the 'resolve' and 'myhostname' modules. The module that reads /etc/resolv.conf is the 'dns' module.
The behavior of the 'dns' module is terrible. If you have three servers listed and the first one is unavailable then every. single. dns. request. must wait for the first server to time out then try the second one.
Also if you have three servers listed and server 3 happens to be the fastest you'll never know because even if the first two servers are down and you finally use it there are two timeouts in between you and that speed.
And since there's only one resolv.conf if you're connected to a split-tunnel VPN you get to choose whether to send all your DNS requests over the tunnel or none of them.
systemd-resolved actually does the right thing in (almost) all of these cases. Built-in kernel IPSec still trips it up because systemd-resolved's view of the world is mapping DNS configuration to interfaces and since kernel IPSec is a policy VPN blah blah nevermind -- it has memory so it can remember if servers are down, and it used to send requests to all listed servers to find the fastest one and prefer it before people complained, and split-tunnel VPNs work!
The "feature" of "merging" DNS zones by relying on query order is pants on head broken as soon as your first DNS server is unreliable or if your first server doesn't return a strict superset of all subsequent servers. If you have internal names both over your VPN and on your local network then no matter what order you pick one of them will be unresolveable.
- iso1631 5y agoAnd if I want to install a forwarder like dnsmasq or resolvd I've always been able to do that. A lot of the problem that people have with systemd is the forcing of it by the distros.