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
net: LookupAddr changed result form in Go 1.5 #12189
Comments
I checked all the Lookup functions. Here is a program to do that (comment out the NS code in Go 1):
Here are some Go versions running on Linux:
Compiled with plain make.bash (so cgo is enabled):
Compiled with CGO_ENABLED=0 make.bash:
It may be different on non-Linux systems, but it seems like literally every release of Go to date has had the trailing dot, while the current 1.5 tree has dropped it. Furthermore, the dropping of the trailing dot in LookupAddr appears to be inconsistent with all the other functions, even in Go 1.5. (LookupTXT doesn't count, since it returns uninterpreted text, but I wanted to run all the Lookups.) For both these reasons I think we should put the final dot back in. I will prepare a CL. |
This is even worse than I thought. There is no code that takes the dot out from the Go lookups. The problem is that by default, and even when you set GODEBUG=netdns=go, the code tries the new C library wrappers before trying pure Go. So not only did the result change, but now each blocked LookupAddr takes a full thread instead of a goroutine. That behavior definitely has to be rolled back. |
Same test ran on
|
CL https://golang.org/cl/13697 mentions this issue. |
CL https://golang.org/cl/17216 mentions this issue. |
… of local source The builtin name resolver using various resolution techniques is a bit complicated and we sometimes fotget to take care of all the go and cgo code paths and exchanging information to local and remote sources. This change makes LookupAddr return absolute domain names even in the case of local source. Updates #12189. Fixes #12240. Change-Id: Icdd3375bcddc7f5d4d3b24f134d93815073736fc Reviewed-on: https://go-review.googlesource.com/17216 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
CL https://golang.org/cl/17411 mentions this issue. |
This change makes existing Lookup API test cases conform to the new return value form that all the Lookup APIs except LookupTXT must return a single or multiple absolute domain names. Updates #12189. Fixes #12193. Change-Id: I03ca09be5bff80e818fbcdc26039daa33d5440a8 Reviewed-on: https://go-review.googlesource.com/17411 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reported via email: LookupAddr("8.8.8.8") returned "google-public-dns-a.google.com." (with trailing dot) in all Go releases to date. In Go 1.5 candidate it returns "google-public-dns.a.google.com" (no trailing dot).
This was an intentional change, in CL 3420, but I believe it was a mistake. The argument made there was that the result was inconsistent depending on whether the C library resolver or the pure Go DNS resolver was being used. But Go 1.4 and earlier never used the C library resolver for this query. So the inconsistency indicated was only introduced after Go 1.4 and does not justify deviating from the Go 1.4 behavior.
I am still investigating and will post more details when I'm done, but right now it looks like we should put the dot back for consistency with all previous Go releases.
The text was updated successfully, but these errors were encountered: