net: add configuration knob to force TCP-only DNS requests in the pure Go resolver on unix #29358
Milestone
Comments
Change https://golang.org/cl/155378 mentions this issue: |
An alternative implementation would be to look for |
jfbus
added a commit
to jfbus/go
that referenced
this issue
Jan 7, 2019
Change https://golang.org/cl/156366 mentions this issue: |
Accepted (proposal 1) for Go 1.13. This is easy and simply implements the existing resolv.conf files more faithfully. |
jfbus
added a commit
to jfbus/go
that referenced
this issue
Apr 18, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Context
There is a DNS resolution bug in Kubernetes (UDP response packets get dropped by conntrack, causing timeouts in DNS queries) : kubernetes/kubernetes#56903
A work-around is to configure the linux resolver to use TCP (e.g. using the
use-vc
option inresolv.conf
).This workaround works with the cgo resolver on glibc-based platforms, but not on musl-based plaforms (e.g. Alpine).
This workaround cannot be used with the pure Go resolver, as it always tries UDP before switching to TCP.
Proposal 1
A solution would be to look for the use-vc option in resolv.conf, and switch to TCP when found.
=> https://go-review.googlesource.com/c/go/+/156366
Proposal 2
Another solution would be to be able to configure the Go resolver to use TCP, either using the GODEBUG env var (e.g.
GODEBUG=netdns=go+tcp
) or using a net.Resolver flag (e.g.PreferTCP
).in net/dnsclient_unix.go
=> https://go-review.googlesource.com/c/go/+/155378
The text was updated successfully, but these errors were encountered: