Skip to content

DNS ​

This page explains how DNS resolution works in a Kubernetes Service environment and in the user clusters running inside it. Understanding this helps to reason about where name resolution happens and which settings you, as a user, can and cannot influence.

Overview ​

There are two layers of DNS to keep in mind:

  1. Environment / infrastructure DNS – how the worker nodes and control plane resolve external names (anything outside the cluster).
  2. In-cluster DNS – how Pods resolve Kubernetes service names (e.g. my-svc.my-namespace.svc.cluster.local) and, ultimately, external names.

Environment DNS resolver ​

When a Kubernetes Service environment is created, you provide one or more DNS servers (see Create a Kubernetes Service Environment).

A DNS resolver runs on the management/seed cluster of your environment. This resolver is configured to use the DNS servers you provided as its upstream. All user-cluster worker nodes are in turn configured to use this seed-side resolver as their upstream DNS server.

As a result:

  • Every external DNS query originating from a worker node (and, by extension, from the Pods running on it) is forwarded to the seed-side resolver, which forwards it to the DNS servers you configured for the environment.
  • The DNS servers you provide during environment creation must be reachable from the environment for the whole duration of its lifecycle. If they become unreachable, external name resolution across the environment will fail.

💡 Note

Choose DNS servers that are reliably reachable from your environment and that can resolve the external names your workloads depend on. This setting affects the entire environment, not a single cluster.

In-cluster DNS (CoreDNS) ​

Each user cluster runs CoreDNS to answer in-cluster DNS queries (service and Pod names within the cluster domain, e.g. cluster.local). For any name that is not part of the cluster domain, CoreDNS forwards the query upstream, which ultimately reaches the environment DNS resolver described above.

⚠️ CoreDNS is fully managed by KKP

The CoreDNS deployment and its configuration inside the user cluster are fully managed by the Kubernetes Service platform (KKP). It is reconciled continuously, which means any manual changes you make to the managed CoreDNS resources (for example editing its ConfigMap/Corefile) will be reverted.

You cannot supply a custom CoreDNS configuration (custom forward zones, stub domains, etc.) by editing the managed objects.

NodeLocal DNSCache (node-local-dns) ​

Kubernetes Service supports the NodeLocal DNSCache feature (node-local-dns). It can be enabled or disabled during cluster creation. It is enabled by default.

When enabled (default):

  • A DNS cache runs on every worker node and listens on a link-local address (169.254.20.10).
  • Pods send their DNS queries to this local cache instead of talking to the cluster-wide CoreDNS service directly.
  • The local cache answers from cache when possible and otherwise forwards:
    • queries for the cluster domain (e.g. cluster.local) to the in-cluster CoreDNS service, and
    • all other (external) queries to the node's configured upstream, which resolves via the environment DNS resolver.

When disabled:

  • No per-node DNS cache is deployed.
  • Pods resolve directly against the cluster-wide CoreDNS service.

Impact of enabling / disabling node-local-dns ​

  • Performance & reliability: A per-node cache reduces DNS latency, lowers load on the central CoreDNS Pods, and avoids certain connection-tracking race conditions that can otherwise cause intermittent DNS timeouts. For most workloads, keeping it enabled is recommended.
  • Additional component: When enabled, an extra DaemonSet runs on every node and an additional link-local listener (169.254.20.10) is present. This is expected and is part of the managed setup.
  • Changing the setting: The option is chosen at cluster creation. Plan accordingly, as toggling DNS behaviour on a running cluster affects how every Pod resolves names.

💡 Note

Regardless of whether node-local-dns is enabled, in-cluster service names are answered by the KKP-managed CoreDNS, and external names are ultimately resolved through the environment DNS resolver that forwards to the DNS servers you configured for the environment.

Resolution path summary ​

The typical path of a DNS query from a Pod:

Cluster-domain names (e.g. cluster.local) are answered by the in-cluster CoreDNS, while external names are forwarded up the chain to the environment DNS servers.