-
Notifications
You must be signed in to change notification settings - Fork 18k
net: LookupAddr returns a zero length slice when looking up its own IP address on a Windows DNS server #29600
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
https://golang.org/pkg/net/#InterfaceAddrs mentions
When no C compiler is installed, net.LookupAddr() is not reporting the unavailability of C like the usual |
You do not need C compiler to use net.LookupAddr on Windows. Alex |
The behavior of net.LookupAddr can be reproduced independently using the Powershell instruction Type 6 does not return a value when not registered in a public DNS in line with the in-addr domain definition rfc1035. Using the
|
Change https://golang.org/cl/178701 mentions this issue: |
Fixes golang#29600 Change-Id: Ie60b5c8f8356dfc16b3ef6d3cee520b9ce6a61aa GitHub-Last-Rev: 76cbdb9 GitHub-Pull-Request: golang#32214 Reviewed-on: https://go-review.googlesource.com/c/go/+/178701 Run-TryBot: Alex Brainman <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alex Brainman <[email protected]>
Fixes golang#29600 Change-Id: Ie60b5c8f8356dfc16b3ef6d3cee520b9ce6a61aa GitHub-Last-Rev: 76cbdb9 GitHub-Pull-Request: golang#32214 Reviewed-on: https://go-review.googlesource.com/c/go/+/178701 Run-TryBot: Alex Brainman <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alex Brainman <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
Output$ go env
What did you do?
What did you expect to see?
Windows Server 2008 R2 Enterprise
Windows Server 2016 Enterprise
192.168.1.2 is a Active Directory server running DNS
dnstest.exe 192.168.1.2
LookupAddr on 192.168.1.2
results: [dns1.example.com.]
What did you see instead?
If I run this program on the DNS server itself, this is the result:
In essence, this program does not return any hostnames when looking up it's own IP address when running on a DNS server under Windows. Instead, it returns a zero length slice. In this situation,
err
is nil.Can someone else reproduce this?
Also, should
err
be set whenlen(addresses) == 0
?The text was updated successfully, but these errors were encountered: