Make resolv.conf generation more deterministic #339
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.
This sorts the resolv.conf entries such that global name servers always
come first and in the order that they're specified. After the global
name servers, try to follow the order that DHCP servers or static
configurations specify. There isn't an attempt to be perfect here since
you could come of with interfaces specifying opposing orders and it
probably wouldn't matter or be that common.
The importance of being more deterministic is that DNS queries go to the
servers in the order listed. If you specify a set of DNS servers to be
used globally, you probably expect them to be queried before anything
supplied by DHCP. Previously the server IP address had an effect on the
order due to the use of maps to collect servers. This led to a confusing
bug different behavior was observed in two different places that was
traced down to on subnet being a 10.x.x.x and the other being a
192.168.x.x and this changing the resolver order.