diff --git a/pkg/protocols/common/protocolstate/state.go b/pkg/protocols/common/protocolstate/state.go index e6bacb49..3298c913 100644 --- a/pkg/protocols/common/protocolstate/state.go +++ b/pkg/protocols/common/protocolstate/state.go @@ -124,7 +124,7 @@ func Init(options *types.Options) error { opts.ResolversFile = true opts.EnableFallback = true } - if options.ResolversFile != "" { + if len(options.InternalResolversList) > 0 { opts.BaseResolvers = options.InternalResolversList } diff --git a/pkg/protocols/dns/dnsclientpool/clientpool.go b/pkg/protocols/dns/dnsclientpool/clientpool.go index fd632bd1..4f019808 100644 --- a/pkg/protocols/dns/dnsclientpool/clientpool.go +++ b/pkg/protocols/dns/dnsclientpool/clientpool.go @@ -34,7 +34,7 @@ func Init(options *types.Options) error { clientPool = make(map[string]*retryabledns.Client) resolvers := defaultResolvers - if options.ResolversFile != "" { + if len(options.InternalResolversList) > 0 { resolvers = options.InternalResolversList } var err error @@ -78,7 +78,7 @@ func Get(options *types.Options, configuration *Configuration) (*retryabledns.Cl poolMutex.RUnlock() resolvers := defaultResolvers - if options.ResolversFile != "" { + if len(options.InternalResolversList) > 0 { resolvers = options.InternalResolversList } else if len(configuration.Resolvers) > 0 { resolvers = configuration.Resolvers diff --git a/pkg/types/types.go b/pkg/types/types.go index 81a27316..c251dc0c 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -66,8 +66,8 @@ type Options struct { IncludeIds goflags.StringSlice // ExcludeIds contains templates ids to not be executed ExcludeIds goflags.StringSlice - - InternalResolversList []string // normalized from resolvers flag as well as file provided. + // InternalResolversList is the list of internal resolvers to use + InternalResolversList []string // ProjectPath allows nuclei to use a user defined project folder ProjectPath string // InteractshURL is the URL for the interactsh server.