Skip to content
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

Respect DNS TTL #23652

Closed
geoffkizer opened this issue Sep 26, 2017 · 4 comments
Closed

Respect DNS TTL #23652

geoffkizer opened this issue Sep 26, 2017 · 4 comments
Labels
enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@geoffkizer
Copy link
Contributor

See #18348 for details on the issue

@karelz karelz changed the title Managed Handler: Respect DNS changes [ManagedHandler] Respect DNS changes Dec 29, 2017
@geoffkizer geoffkizer changed the title [ManagedHandler] Respect DNS changes [ManagedHandler] Respect DNS TTL Jan 25, 2018
@geoffkizer
Copy link
Contributor Author

The tricky part here is retrieving the TTL. The standard DNS APIs on Windows/Linux don't seem to support this. On Windows there's DnsQueryEx, which seems to do what we want. On Linux, all I could find was some 3rd party DNS libraries, which is not ideal.

Ideally, TTL would be exposed via standard managed DNS APIs like Dns.GetHostEntryAsync. It could be a new field on the IPHostEntry class.

@geoffkizer
Copy link
Contributor Author

@wfurt Any suggestions on how to get this info on Linux?

@wfurt
Copy link
Member

wfurt commented Jan 25, 2018

I don't. I look at some of the API and come to same conclusion. Using libresolv may be best we can get to. https://docs.oracle.com/cd/E36784_01/html/E36873/libresolv-3lib.html (libresolv.9.dylib on OSX)
If we cannot get TTL per record, we may try to get TTL from SOA record. That would still be better approximation than fixed time e.g. zone owner would have ability to hint validity of the records.
(https://en.wikipedia.org/wiki/SOA_record)

Since we are talking about expiring resolved name, we may also put some consideration to logic when multiple addresses are returned. I don't know what exactly we do but we may consider fallback if connect to one address fails as well as load-ballancing. Either one can have some implications. (so as preferring IPv6 over v4 (or vice versa) )

@karelz karelz changed the title [ManagedHandler] Respect DNS TTL Respect DNS TTL May 16, 2018
@stephentoub
Copy link
Member

Since Dns doesn't provide the ability to get this data, and since PooledConnectionLifetime enables a similar goal, I'm going to close this for now.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 3.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

No branches or pull requests

4 participants