Skip to content
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: ResolveIPAddr cannot parse an IPv6 address enclosed in square brackets #3837

mikioh opened this issue Jul 17, 2012 · 1 comment


Copy link

@mikioh mikioh commented Jul 17, 2012

What steps will reproduce the problem?
1. call ResolveIPAddr("ip", "[::1]")

What is the expected output? What do you see instead?
No error return but got an error ``[::1]: no such host''.

Please use labels and text to provide additional information.
ResolveIPAddr("ip", "::1") works well, oops.

This comment has been minimized.

Copy link
Contributor Author

@mikioh mikioh commented Aug 3, 2012

Comment 2:

Russ said at golang-dev:
[::] is no more an IP address than The syntax for adding a 
port to an IPv6 address is [addr]:port, but the [] are not part of the 
In addition to being consistent with the RFCs, this appears to be 
consistent with other Unix programs. For example, on my Mac: 
$ telnet '[::1]' 
[::1]: nodename nor servname provided, or not known 
$ telnet ::1 
Trying ::1... 
telnet: connect to address ::1: Connection refused 
telnet: Unable to connect to remote host 
Makes sense.

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.