From e4b3730fa274ed79957a577de2beee221fd98fa7 Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Mon, 11 Nov 2019 21:20:19 -0700 Subject: [PATCH] Go DNS lookup order hack --- pkg/cli/cmds/root.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/cli/cmds/root.go b/pkg/cli/cmds/root.go index b18c5d8f050..c612ef37407 100644 --- a/pkg/cli/cmds/root.go +++ b/pkg/cli/cmds/root.go @@ -2,6 +2,7 @@ package cmds import ( "fmt" + "os" "github.com/rancher/k3s/pkg/version" "github.com/sirupsen/logrus" @@ -12,6 +13,13 @@ var ( debug bool ) +func init() { + // hack - force "file,dns" lookup order if go dns is used + if os.Getenv("RES_OPTIONS") == "" { + os.Setenv("RES_OPTIONS", " ") + } +} + func NewApp() *cli.App { app := cli.NewApp() app.Name = appName