-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vsock_proxy: Perform DNS resolution after the expiration of the TTL #593
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meerd
force-pushed
the
dns_resolve
branch
3 times, most recently
from
April 9, 2024 09:48
a59972b
to
b78b6c4
Compare
Use an enumeration type (IpAddrType) instead of boolean variables to represent different IP address types. Signed-off-by: Erdem Meydanli <[email protected]>
- Create a new module 'dns.rs' to encapsulate DNS-related operations. - Move existing DNS-related functionality into the new 'dns.rs' module. - Rename 'parse_addr' function to 'resolve' for better semantic clarity. Signed-off-by: Erdem Meydanli <[email protected]>
Rename starter.rs module to proxy.rs to better reflect its purpose. Signed-off-by: Erdem Meydanli <[email protected]>
Perform allowlisted hosts' check before creating a Proxy instance and terminate the application if necessary. Signed-off-by: Erdem Meydanli <[email protected]>
The proxy used to resolve the server hostname only once during its startup. This behavior was creating issues where the DNS addresses changed frequently. This commit changes the behavior to resolve DNS each time after the TTL expires. Signed-off-by: Erdem Meydanli <[email protected]>
This commit resolves all errors and warnings that surfaced after upgrading from rustc v1.60 to v1.68.2. Signed-off-by: Erdem Meydanli <[email protected]>
meerd
force-pushed
the
dns_resolve
branch
4 times, most recently
from
April 10, 2024 06:32
6161520
to
ae2e1e1
Compare
meerd
changed the title
[WIP] vsock_proxy: Perform DNS resolution after the expiration of the TTL
vsock_proxy: Perform DNS resolution after the expiration of the TTL
Apr 10, 2024
foersleo
reviewed
Apr 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the comments about the mismatch in error message and test pointed out before this looks good to me.
foersleo
approved these changes
Apr 10, 2024
mariusknaust
approved these changes
Apr 10, 2024
meerd
force-pushed
the
dns_resolve
branch
2 times, most recently
from
April 11, 2024 15:19
f444244
to
30e7686
Compare
Modify the signature of `dns::resolve` function to return a `DnsResolveResult` struct instead of a plain vector of IP addresses. Signed-off-by: Erdem Meydanli <[email protected]>
Add tests for the dns module to improve coverage. Signed-off-by: Erdem Meydanli <[email protected]>
Replace the existing DNS lookup implementation with hickory_resolver. This allows accessing additional information from DNS records, such as TTL values, and enhances the functionality of the dns module. Signed-off-by: Erdem Meydanli <[email protected]>
Replace DnsResolveResult with DnsResolutionInfo. The new type includes utility methods and provides a better interface for DNS resolution information, encapsulating resolved IP address, TTL value, and last resolution time. Signed-off-by: Erdem Meydanli <[email protected]>
This commit marks the new release of the vsock_proxy, setting the version to 1.0.0. Signed-off-by: Erdem Meydanli <[email protected]>
This was referenced Apr 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of changes: This PR addresses the wrong assumption that domain names are resolved to fixed static IP addresses. With these changes, vsock-proxy periodically refreshes the resolved IP address of the remote host after the Time-To-Live (TTL) expires, ensuring that the most up-to-date IP address is used.
Relevant issues: #553
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.