net: LookupCNAME inconsistency on unix systems #59943
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
So there was a #50101 proposal to make the LookupCNAME consistent between unix/windows, or more concrete to make it send an explicit CNAME query, so that when the last CNAME doesn't have an ending A/AAAA record it returns the CNAME. So the change made the cgo version to use the res_search routines instead of getaddrinfo.
And that leads to some compat breaking changes that were made because of this change and some minor differences between linux/windows.
Current Issues:
go/src/net/cgo_unix.go
Lines 296 to 300 in 0d34754
go/src/net/lookup_unix.go
Lines 102 to 110 in 0d34754
getaddrinfo
, so when in nsswitch.conf is different in any way from:hosts: dns
it returns the wrong result (different that before that change), because of the fallback to go (Issue 1) this is not really noticeable, because the go resolver handles/etc/hosts
aliases correctly. (but for other nss modules it might cause problems (mdns, myhostname, resolve, ....))I made before a CL 455275 to try address that problems.
The best solution to fix that is to do something like (for cgo resolver):
Try with
getaddrinfo
, if it doesn't find anything (returnserrNoSuchHost
) then try withres_search
query for CNAME.CC @ianlancetaylor
The text was updated successfully, but these errors were encountered: