Increase DNS timeout for CoreDNS users (#5000)

* Increase DNS timeout for CoreDNS users

CoreDNS forward plug-in fails in ~6s, then fallback triggers.
However, the default timeout of glibc and musl is 5s. Increase
default timeout to make sure CoreDNS fallback is working
on first query.

* Pass option as list
This commit is contained in:
Stefan Agner 2024-04-05 09:40:57 +02:00 committed by GitHub
parent a894c4589e
commit c3c17b2bc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -177,6 +177,11 @@ class DockerAPI:
if dns:
kwargs["dns"] = [str(self.network.dns)]
kwargs["dns_search"] = [DNS_SUFFIX]
# CoreDNS forward plug-in fails in ~6s, then fallback triggers.
# However, the default timeout of glibc and musl is 5s. Increase
# default timeout to make sure CoreDNS fallback is working
# on first query.
kwargs["dns_opt"] = ["timeout:10"]
if hostname:
kwargs["domainname"] = DNS_SUFFIX