Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.15.7 linux/amd64
Does this issue reproduce with the latest release?
Haven't tried go1.16-rc1 or tip
What operating system and processor architecture are you using (go env
)?
The problem has been reproduced with Microsoft Windows [Version 10.0.19042.746], WSL2 with Ubuntu 20.04
What did you do?
Run this program on WSL2 with Ubuntu 20.04. It is a very simple program, essentially just calling net.LookupHost
fmt.Printf("Looking up %q\n", host)
addrs, err := net.LookupHost(host)
if err != nil {
fmt.Printf("- Failed with error: %v\n", err)
} else {
for _, addr := range addrs {
fmt.Printf("- Addr: %v\n", addr)
}
}
What did you expect to see?
I expected it to resolve names correctly
What did you see instead?
$ ./host prevasonline.sharepoint.com
Looking up "prevasonline.sharepoint.com"
- Failed with error: lookup prevasonline.sharepoint.com on 172.29.224.1:53: cannot unmarshal DNS message
$ GODEBUG=netdns=go ./host prevasonline.sharepoint.com
Looking up "prevasonline.sharepoint.com"
- Failed with error: lookup prevasonline.sharepoint.com on 172.29.224.1:53: cannot unmarshal DNS message
$ GODEBUG=netdns=cgo ./host prevasonline.sharepoint.com
Looking up "prevasonline.sharepoint.com"
- Addr: 13.107.136.9
This issue was originally from rclone/rclone#4984 and @hstaugaard and @black-snow have reported it. I (@ncw) haven't verified it personally since I don't have Windows with WSL2.
This issue is superficially similar to #37362 and #36718 but the adddress in question doesn't have any SRV records and we aren't doing an SRV query, just HostLookup