Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
net: support single-request resolv.conf option in pure Go resolver #29644
There is a DNS resolution issue in Kubernetes (UDP response packets get dropped by conntrack, causing timeouts in DNS queries): kubernetes/kubernetes#56903
The issue is apparently caused by a race in conntrack between concurrent A and AAAA queries: https://www.weave.works/blog/racy-conntrack-and-dns-lookup-timeouts
A work-around is to configure the linux resolver to use TCP (e.g. using the use-vc option in resolv.conf), as discussed in #29358.
Another workaround is to enable single-request / single-request-reopen in resolv.conf in order to use sequential A and AAAA queries instead of concurrent queries - http://man7.org/linux/man-pages/man5/resolv.conf.5.html
When parsing resolv.conf, we look for single-request/single-request-reopen and when set, do sequential queries in goLookupIPCNAMEOrder.
Here is what could be a small-footprint change:
Current code with concurrency: