Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRespect DNS TTL #23652
Respect DNS TTL #23652
Comments
|
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. |
|
@wfurt Any suggestions on how to get this info on Linux? |
|
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) 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) ) |
|
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. |
See #18348 for details on the issue