From ad0795efc29d6adec54db7ec6d3e314eb82e9b29 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 27 Apr 2020 20:24:53 +0200 Subject: [PATCH] net/dnscache: don't use the Go resolver on Android The local resolver is not available for apps on Android. Signed-off-by: Elias Naur --- net/dnscache/dnscache.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/dnscache/dnscache.go b/net/dnscache/dnscache.go index 9de232e11..c63581d78 100644 --- a/net/dnscache/dnscache.go +++ b/net/dnscache/dnscache.go @@ -31,6 +31,11 @@ func preferGoResolver() bool { return false } + // The local resolver is not available on Android. + if runtime.GOOS == "android" { + return false + } + // Otherwise, the Go resolver is fine and slightly preferred // since it's lighter, not using cgo calls & threads. return true