Don't overwrite old DNS results with empty list #1260
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 should improve DNS static_host_map entries for some users, such as the scenario described in this comment: #909 (comment)
The
hostnamesResults.ips
variable is used to build the list of available underlay IPs for a given VPN IP. All hostnames are queried onstatic_map.cadence
andhr.ips
is updated when the new list of resolved IPs is different from the old list. A more detailed explanation can be found here.This could cause slow reconnects after connectivity loss:
static_host_map
entry for a Lighthouse that points at a DNS name onlystatic_map.cadence
In addition to the above fix, I renamed
NewHostnameResults
toNewHostnamesResults
which matches the struct's name and includedvpnIp
in logs related to the DNS resolution.Some notes:
static_host_map
in addition to a DNS name, prior DNS resolutions will still be overwrittenstatic_host_map
entries defines multiple DNS names, and one resolves while another fails, any prior results for the failed DNS name will still be overwrittenRemoteList.dnsCache
, using the hostname as map key, similar toRemoteList.cache
which uses the Lighthouse/self vpnIp as map key:nebula/remote_list.go
Lines 198 to 201 in 3e6c755
Example logs:
Using config:
Where
foobar.johnmaguire.me
was never resolvable buthome.johnmaguire.me
was resolvable at startup and then became unresolvable.