Skip to content

net: Resolver.LookupNetIP strips IPv6 zone from resolved addresses #81601

Open

Description

@database64128

Go version

go version go1.27.1-X:nodwarf5 linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v3'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN='/home/database64128/go/bin'
GOCACHE='/home/database64128/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/database64128/.config/go/env'
GOEXE=''
GOEXPERIMENT='nodwarf5'
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1790460134=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/home/database64128/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPACKAGESDRIVER=''
GOPATH='/home/database64128/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/home/database64128/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/lib/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.27.1-X:nodwarf5'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Call net.Resolver.LookupNetIP to resolve a .local mDNS hostname.

What did you see happen?

The returned IP addresses include link-local IPv6 addresses without the zone identifier.

What did you expect to see?

The IPv6 link-local addresses have the correct zone identifier, as returned by the cgo resolver.

This is a simple fix. Sending a CL.

Update: mailed CL 835285

Activity

  1. gopherbot commented on Sep 18, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/835285 mentions this issue: net: preserve IPv6 zone in Resolver.LookupNetIP

  2. added
    FixPendingIssues that have a fix which has not yet been reviewed or submitted.
    on Sep 18, 2026
  3. added this to the Backlog milestone on Sep 18, 2026
  4. cherrymui commented on Sep 18, 2026

    @cherrymui
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixPendingIssues that have a fix which has not yet been reviewed or submitted.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions