kubernetes/kops · error

unknown DNS type %q

Error message

unknown DNS type %q

What it means

The cluster's network topology specifies a DNS type other than Public or Private when building the DNS zone task; an unrecognized topology.dns value in the cluster spec.

Source

Thrown at pkg/model/awsmodel/dns.go:58

	// Configuration for a DNS zone
	dnsZone := &awstasks.DNSZone{
		Name:      new(b.NameForDNSZone()),
		Lifecycle: b.Lifecycle,
	}

	topology := b.Cluster.Spec.Networking.Topology
	if topology != nil {
		switch topology.DNS {
		case kops.DNSTypePublic:
		// Ignore

		case kops.DNSTypePrivate:
			dnsZone.Private = new(true)
			dnsZone.PrivateVPC = b.LinkToVPC()

		default:
			return fmt.Errorf("unknown DNS type %q", topology.DNS)
		}
	}

	if !strings.Contains(b.Cluster.Spec.DNSZone, ".") {
		// Looks like a hosted zone ID
		dnsZone.ZoneID = new(b.Cluster.Spec.DNSZone)
	} else {
		// Looks like a normal DNS name
		dnsZone.DNSName = new(b.Cluster.Spec.DNSZone)
	}

	c.EnsureTask(dnsZone)
	return nil
}

func (b *DNSModelBuilder) Build(c *fi.CloudupModelBuilderContext) error {
	// Add a HostedZone if we are going to publish a dns record that depends on it
	if b.Cluster.PublishesDNSRecords() {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Set the topology DNS setting to Public or Private
  2. Clear the topology block if public DNS is intended
  3. Validate the cluster spec with kops validate cluster
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/model/awsmodel/dns.go:58 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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