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: pure Go resolver(netdns) can not resolve hostname.local #35067
Comments
Yes, that's known, as the docs at https://golang.org/pkg/net/#hdr-Name_Resolution imply, and we're unlikely to implement it. If you need to resolve those names, use a different resolver. |
@bradfitz Hi, thanks for your reply . I know sth about this before writing the issue. Could u plz tell me why not to implement it ? What is the consideration? |
It's a lot of code for very few users and the system DNS resolver is usually fine. The advantage of using the pure Go resolver is usually to avoid cgo and expensive threads being tied up during resolution, but that only matters when you have, say, tens of thousands of outstanding lookups. (e.g. you're a web crawler binary) But if you have tens of thousands of mDNS lookups outstanding, you probably have bigger problems on your LAN. |
Hope you don't mind me hijacking this for quick question... @bradfitz - what is the default behaviour in the absence of |
@alex-leonhardt The default behavior is system dependent. Which system are you asking about? In general questions are better asked on a forum; see https://golang.org/wiki/Questions. |
Thanks @ianlancetaylor - i'll ask in slack or the forums. My apologies. |
The problem with not solving this is that a Go app will fail to load a URL while curl and ping succeed. This makes for some pretty odd troubleshooting, especially for someone using a Go app rather than writing one. It very much will affect anyone using an Airport Extreme access point (or anything that behaves similarly - ie, not registering DNS entries automatically for all DHCP clients). And while that admittedly will be a ridiculous target audience to support sooner rather than later, I don't think we are quite there until the next WiFi standard is ubiquitous. People with Macbook Pros should absolutely be a target audience though, and they're in this Venn Diagram of obscure error messages. |
@jdmarshall this only affects Go binaries using the built in dns resolver which is not the default. That is, you have to opt into this reduced functionality. |
So I should file an issue with the package experiencing this problem? |
Yes please |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Just run
GODEBUG=netdns=go+4 go run test.go
What did you expect to see?
Resolve to
127.0.0.1
What did you see instead?
resolve yonghaohu-mac.local failed: dial tcp: lookup yonghaohu-mac.local on 10.22.12.45:53: no such host
The text was updated successfully, but these errors were encountered: