-
Notifications
You must be signed in to change notification settings - Fork 18k
net: cgo lookups do not recheck resolv.conf #10850
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
I don't know to implement this. Is there a way to tell the libc resolver library to recheck resolv.conf? |
I don't think there's anything to do here. The whole point of letting libc handle it is to let libc handle it. But in Go 1.5 we try to handle most lookups in Go, which makes the priority of changing the libc resolver even less important. (And any backslash escape issue should be handled separately, if it still occurs in Go 1.5) |
But Darwin and some other situations will always use C, no? In that case, we are making behavior completely inconsistent across OS. So someone would advertise a product that will continue working in Linux, but fail in OSX when changing networks. |
Darwin's libc resolver via lookupd is very good. It will notice files change. I think this concern is theoretical. |
OK, that's good - I'm not a Darwin guy so did not know. So the only inconsistency should be I guess when weird domain names are punted to C. Which is rather rare, but still exists as an inconsistency. But I will concede that it is rather theoretical to happen in reality. I can however reproduce it (by looking up domain with escapes and changing resolv.conf files out). |
I've never seen a C program call res_init to force reloading. |
Native Go lookups recheck /etc/resolv.conf at minimum every 5 seconds. Cgo lookups should do the same. Currently, you can run into an issue where resolv.conf changes, Go picks it up, but a strange hostname (with \ escapes) is kicked to cgo and fails.
The text was updated successfully, but these errors were encountered: