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: DefaultResolver.Lookup{Host,IPAddr} and LookupHost fail to parse a literal IPv6 address w/ zone #20790

mikioh opened this issue Jun 25, 2017 · 1 comment


Copy link

@mikioh mikioh commented Jun 25, 2017

When GODEBUG=netdns=go or Resolver.PreferGo is true, DefaultResolver.Lookup{IPAddr,Host} and LookupHost fail to parse a literal IPv6 address w/ zone like the following:

% go run x.go 
lookup fe80::1%lo0: no such host
exit status 1

package main

import (

func main() {
	r := &net.Resolver{PreferGo: true}
	ipas, err := r.LookupIPAddr(context.Background(), "fe80::1%lo0")
	if err != nil {

Hope this is the last one of long standing issues regarding inconsistency between GODEBUG=netdns=cgo and GODEBUG=netdns=go. The fix would be simply to replace the use of ParseIP with a pair of parseIPv4 and parseIPv6, so this is probably a good first contribution issue.

Copy link

@gopherbot gopherbot commented Nov 26, 2017

Change mentions this issue: net: Parse IPv6 address with zone using DefaultResolver.Lookup{Host,IPAddr}

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
4 participants
You can’t perform that action at this time.