Skip to content

Commit

Permalink
Merge pull request #6 from projectdiscovery/disable-system-resolvers
Browse files Browse the repository at this point in the history
disabled system resolvers
  • Loading branch information
Mzack9999 committed Apr 24, 2020
2 parents 2820597 + b31a246 commit a5a897c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dns

import (
"errors"
"fmt"
"math/rand"
"time"

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a5a897c

Please sign in to comment.