net: cannot enforce usage of netgo for DNS resolution #33904
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
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?
Tried to enforce the usage of netgo for DNS resolution with the
netgo
tag.In some machines, even when
netgo
tag is used during compilation and when havingGODEBUG=netdns=go
in the environment, cgo is being used for DNS resolution.These machines have
options edns0
in their/etc/resolv.conf
.I'm trying to enforce the usage of netgo for DNS resolution to overcome an issue similar to this one. The known workaround is to use netgo for DNS resolution.
lookuphost_example.go - https://play.golang.org/p/CgzqQXsSgvd
Build Command:
go build -tags netdns lookuphost_example.go
What did you expect to see?
I expected Go to use netdns for DNS resolution.
What did you see instead?
In machines with
options edns0
in/etc/resolv.conf
, it still uses cgo for DNS resolution.After removing the
edns0
entry fromresolv.conf
, the issue is resolved.The text was updated successfully, but these errors were encountered: