• jfbus's avatar
    net: support single-request resolv.conf option in pure Go resolver · dbc17037
    jfbus authored
    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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
    dbc17037
dnsclient_unix_test.go 42.1 KB