Fix systemd-resolved DNS management #1968
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Address some of the issues raised in #1952. The underlying issue is that the daemon would attempt to parse
/etc/resolv.conf
by a rather strict parser that would fail due to there being an unknown option being added to the file. The file is parsed to check if it contains the local resolver address to address cases where the user might've changed the file. This behavior has been removed, but we should test this out more extensively to see what happens on older distributions. The DNS management has also been simplified with systemd-resolved by not using it when the stubresolv.conf
file is not symlinked. This is because in case the realresolv.conf
file is being used, the glibc resolver will be used, and it will query the first 3 DNS servers listed inresolv.conf
in order, switching over to the next one after a timeout - since the user usually has at least one other DNS server configured before they connect, there will always be a second of latency added to all DNS requests at best or they will always time out at worst, when connected to a tunnel. Thus, it's just easier to fall back to methods that will manage DNS in cruder ways.This change is