owasp-amass/amass · error
no valid resolvers were found
Error message
no valid resolvers were found
What it means
After parsing and type-asserting resolver entries to strings, loadResolverSettings deduplicates the list and requires at least one valid resolver. If the list is empty after validation, this error is returned because enumeration cannot proceed without a resolver.
Source
Thrown at config/resolvers.go:210
absPath, err := c.AbsPathFromConfigDir(rStr)
if err != nil {
return fmt.Errorf("failed to get absolute path for resolver file: %w", err)
}
fileResolvers, err := c.loadResolversFromFile(absPath)
if err != nil {
return fmt.Errorf("failed to load resolvers from file: %w", err)
}
resolversList = append(resolversList, fileResolvers...)
}
// Deduplicate the list of resolvers and assign to c.Resolvers.
resolverIPs := stringset.Deduplicate(resolversList)
if len(resolverIPs) == 0 {
return errors.New("no valid resolvers were found")
}
c.Resolvers = resolverIPs
return nil
}
func (c *Config) loadResolversFromFile(path string) ([]string, error) {
absPath, err := filepath.Abs(path)
if err != nil {
return nil, fmt.Errorf("failed to get absolute path: %v", err)
}
data, err := os.ReadFile(absPath)
if err != nil {
return nil, fmt.Errorf("failed to open resolvers file: %w", err)
}
View on GitHub (pinned to 79299dce87)
Solutions
- Add at least one valid resolver IP (e.g. 8.8.8.8) to the list.
- Remove empty or placeholder entries that fail validation.
- Verify entries parse as valid IPs/addresses.
- Confirm the right config file/environment is loaded.
Example fix
# before resolvers: [] # after resolvers: - 8.8.8.8 - 1.1.1.1
Defensive patterns
Strategy: validation
Validate before calling
if len(resolvers) == 0 || allEmpty(resolvers) {
return errors.New("at least one non-empty resolver is required")
} Try / catch
if err := loadResolverSettings(cfg); err != nil {
if strings.Contains(err.Error(), "no valid resolvers") {
// fall back to well-known public resolvers (8.8.8.8, 1.1.1.1)
}
return err
} Prevention
- Keep at least one public resolver in every config profile.
- Strip blank entries or warn on them during config lint.
- Validate entries are well-formed IPs before running.
- Test configs in CI with a loader dry-run.
When it happens
Trigger: Calling loadResolverSettings where resolversList resolves to zero entries after parsing/validation — e.g. a resolvers list with only empty strings or entries rejected by validation — so len(resolverIPs) == 0.
Common situations: An empty resolvers list in the config (resolvers: [] or only blank entries), environment-specific configs stripped of resolver addresses, or validation dropping malformed addresses leaving none.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- brute forcing cannot be performed without DNS resolution
- active enumeration cannot be performed without DNS resolutio
- no resolver keys were found in the resolvers section
- resolvers section is not a list
- alterations wordlist_file item is not a string
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/0e0c5e2240e571d0.
Report an issue: GitHub.