kubernetes/kops · error

DNS provider does not support zones

Error message

DNS provider does not support zones

What it means

newDNSCache requires every configured DNS provider to expose a Zones() provider. If a provider's Zones() call returns ok=false, dns-controller cannot manage DNS records with it and construction fails with this error.

Source

Thrown at dns-controller/pkg/dns/dnscache.go:45

// dnsCache is a wrapper around the DNS provider, adding some caching
type dnsCache struct {
	// zonesProviders is a slice of configured DNS providers
	zonesProviders []dnsprovider.Zones

	// mutex protects the following mutable state
	mutex sync.Mutex

	cachedZones          []dnsprovider.Zone
	cachedZonesTimestamp int64
}

func newDNSCache(providers []dnsprovider.Interface) (*dnsCache, error) {
	var zonesProviders []dnsprovider.Zones
	for _, provider := range providers {
		zonesProvider, ok := provider.Zones()
		if !ok {
			return nil, fmt.Errorf("DNS provider does not support zones")
		}
		zonesProviders = append(zonesProviders, zonesProvider)
	}

	return &dnsCache{
		zonesProviders: zonesProviders,
	}, nil
}

// nanoTime is a stand-in until we get a monotonic clock
func nanoTime() int64 {
	return time.Now().UnixNano()
}

// ListZones returns the zones, using a cached copy if validity has not yet expired.
// This is not a cheap call with a large number of hosted zones, hence the caching.
func (d *dnsCache) ListZones(validity time.Duration) ([]dnsprovider.Zone, error) {
	d.mutex.Lock()

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Switch to a DNS provider that supports zones (e.g. route53, google-clouddns, aws-route53-sso).
  2. Check which providers were passed to NewDNSController (log the --dns flag value) and confirm it implements dnsprovider.Zones.
  3. Update or reinstall the dnsprovider plugin if a broken build omitted zone support.

Example fix

// before
dns-controller --dns=unsupported-provider
// after
dns-controller --dns=aws-route53
Defensive patterns

Strategy: validation

Validate before calling

for _, p := range providers {
	if _, ok := p.Zones(); !ok {
		return fmt.Errorf("provider %T does not support zones; choose a zone-capable --dns provider", p)
	}
}

Type guard

func supportsZones(p dnsprovider.Interface) bool {
	_, ok := p.Zones()
	return ok
}

Try / catch

dnsctl, err := dns.NewDNSController(providers, zoneRules, interval)
if err != nil {
	klog.Fatalf("DNS controller init: %v", err)
}

Prevention

When it happens

Trigger: NewDNSController is called with a dnsprovider.Interface whose Zones() does not return a zones provider — typically a provider plugin that doesn't implement zone listing or was misconfigured.

Common situations: Using a DNS provider binary/implementation that lacks zone support; provider plugin initialization silently succeeded but the backend is unsupported; wrong --dns flag selecting an inappropriate provider.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/c10bb8499ab9a7ee. Report an issue: GitHub.