kubernetes/kops · error
unknown DNS provider
Error message
unknown DNS provider %q
What it means
InitDnsProvider looks up a registered DNS provider plugin by name; if the name is registered but its factory returns nil without error, or more typically the name is not in the plugin registry, dns comes back nil and this error is thrown. It means the requested DNS provider (e.g. from --dns=... or KOPS_DNS_FLAG) is not compiled in or not registered.
Solutions
- Check the exact provider name spelling against the registered names in dnsprovider/pkg/dnsprovider/plugins.go (e.g. 'aws-route53').
- Use a standard kOps release build that includes the DNS provider plugin you need.
- If building from source, ensure the provider package is imported so its init() registers the factory.
Example fix
// before
client, err := dnsprovider.InitDnsProvider("route53", "")
// after
client, err := dnsprovider.InitDnsProvider("aws-route53", "") Defensive patterns
Strategy: validation
Validate before calling
// verify the provider is registered before use
providers := dnsprovider.GetDnsProviders()
if _, ok := providers["aws-route53"]; !ok {
return fmt.Errorf("DNS provider %q not available in this build", providerName)
} Prevention
- Use the exact registered provider name constants (e.g. 'aws-route53').
- Prefer standard release binaries which register all supported providers.
- When building from source, verify the provider package is imported by the binary.
When it happens
Trigger: Calling InitDnsProvider(name, ...) with a provider name that has no registered factory in dnsprovider/pkg/dnsprovider/plugins.go, so the lookup returns nil.
Common situations: Typo in the provider name (aws-route53 vs aws); building a trimmed binary that excludes a provider plugin; using a provider removed in a newer kOps version (e.g. vsphere/google); custom builds without the plugin import.
Related errors
- cannot find DNS Zone
- DNS provider does not support zones
- error building DNS provider
- error building DNS provider
- error parsing
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/8cabfd27cc49d436.
Report an issue: GitHub.
Appendix: source
Thrown at dnsprovider/pkg/dnsprovider/plugins.go:105
var config *os.File
config, err = os.Open(configFilePath)
if err != nil {
return nil, fmt.Errorf("couldn't open DNS provider configuration %s: %#v", configFilePath, err)
}
defer config.Close()
dns, err = GetDnsProvider(name, config)
} else {
// Pass explicit nil so plugins can actually check for nil. See
// "Why is my nil error value not equal to nil?" in golang.org/doc/faq.
dns, err = GetDnsProvider(name, nil)
}
if err != nil {
return nil, fmt.Errorf("could not init DNS provider %q: %v", name, err)
}
if dns == nil {
return nil, fmt.Errorf("unknown DNS provider %q", name)
}
return dns, nil
}
View on GitHub (pinned to 4c8573c808)