]> Cypherpunks repositories - gostls13.git/commit
net: support single-request resolv.conf option in pure Go resolver
authorjfbus <jf@bustarret.com>
Tue, 26 Mar 2019 18:21:53 +0000 (18:21 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 17 Apr 2019 14:42:35 +0000 (14:42 +0000)
commitdbc17037815bdce5df3f355f2171c57804f7870e
treed1b7e6669f254f3642b3e9aa3c11d151cc6d9bb5
parent33e5da48d5d22a722f2363b15e2d53061fb71cf4
net: support single-request resolv.conf option in pure Go resolver

There is a DNS resolution issue in Kubernetes (UDP response packets get dropped due to a race in conntrack between the parallel A and AAAA queries, causing timeouts in DNS queries).

A workaround is to enable single-request / single-request-reopen in resolv.conf in order to use sequential A and AAAA queries instead of parallel queries.

With this PR, the pure Go resolver searches for "single-request" and "single-request-reopen" in resolv.conf and send A and AAAA queries sequentially when found.

Fixes #29644

Change-Id: I906b3484008c1b9adf2e3e9241ea23767e29df59
GitHub-Last-Rev: d481acfb4c49d82fd474078b31a1a4697b57dadf
GitHub-Pull-Request: golang/go#29661
Reviewed-on: https://go-review.googlesource.com/c/go/+/157377
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/dnsclient_unix.go
src/net/dnsclient_unix_test.go
src/net/dnsconfig_unix.go
src/net/dnsconfig_unix_test.go
src/net/testdata/single-request-reopen-resolv.conf [new file with mode: 0644]
src/net/testdata/single-request-resolv.conf [new file with mode: 0644]