From b31a246865e389029d5ccb56ce8dda79917e6427 Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Fri, 24 Apr 2020 20:45:07 +0200 Subject: [PATCH] disabled system resolvers --- client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 3694ca6..7d52eb4 100644 --- a/client.go +++ b/client.go @@ -2,6 +2,7 @@ package dns import ( "errors" + "fmt" "math/rand" "time" @@ -29,10 +30,9 @@ func New(baseResolvers []string, maxRetries int) (*Client, error) { client := Client{maxRetries: maxRetries} - // Attempt to retrieve the resolvers from the resolv.conf file on Linux/Unix - // ignoring errors as it would return an empty list - resolvers, _ := ReadResolveConfig("/etc/resolv.conf") - client.resolvers = append(client.resolvers, resolvers...) + if len(baseResolvers) == 0 { + return nil, fmt.Errorf("No resolvers provided") + } // Append the static list of resolvers if they were given as input to the // resolvers array.