-
Notifications
You must be signed in to change notification settings - Fork 18k
net: ability to replace Resolver impl #17554
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
Comments
Since I see there's |
It is a concrete type and not an interface on purpose. That lets us extend it with options, like we have with Dialer. The TODO is about adding an interface or bag of funcs to the Resolver to call first, before the default implementation. But I'd like to push that off until Go 1.9. |
FWIW, I tried working on an implementation of this that would let people override a // runtimeNano returns the current value of the runtime clock in nanoseconds. func runtime_pollServerInit() |
Is this a dupe of #12503 ? |
@kisielk, yes, thanks. I'll close this one. |
The
net.Resolver
struct has the following TODOs:I'm interested in overriding the implementation. Specifically, I'd like to write a lookup function that ignores TTL's/returns the last good IP addresses if the DNS provider times out or returns an error instead of returning valid IP addresses. In theory that would help reliability during outages like Dyn's, where many sites were probably still available at their last known IP addresses, but the DNS resolver returned no responses for those sites.
I could override the DialContext currently, but that feels like overriding too much.
I'm happy to suggest ideas for an interface but I haven't done a ton of work with DNS and don't trust my instincts too much. @bradfitz, do you have ideas for the interface? I checked the commit and Github issues and couldn't find anything.
The text was updated successfully, but these errors were encountered: