✦ For everyone, free.

Practical knowledge for real and everyday life

Home

1.16 Kubernetes DNS Definition

Kubernetes DNS Definition explains how Kubernetes manages DNS for containers, ensuring service discovery through integrated DNS servers.

Kubernetes DNS Definition is the precise characterization of the cluster's internal DNS system as an in-cluster service that automatically generates and resolves predictable domain names for Services and, optionally, Pods, defined specifically to give workloads a stable naming convention that does not depend on knowing any object's underlying IP address in advance.


DNS as an In-Cluster Service, Not an External System

Running Inside the Cluster It Serves

Cluster DNS is defined as a workload running within the cluster itself, typically as a Deployment exposed through its own Service, rather than as an external system the cluster merely points to; this means the DNS service is itself subject to the same scheduling, scaling, and failure characteristics as any other cluster workload.

Automatic Record Generation

A defining property of cluster DNS is that its records are not manually configured; they are generated automatically as Services and, depending on configuration, Pods are created, changed, or deleted, keeping name resolution continuously in sync with the cluster's actual object state.

DNS record = f ( Service or Pod object )

The Naming Convention

Structure of a Service Name

A Service's DNS name is defined by a fixed structure combining its name, its namespace, and a cluster-wide domain suffix, allowing any workload in the cluster to resolve any Service by a fully qualified name regardless of which namespace the requester resides in.

Shortened Forms Within a Namespace

Within the same namespace as the Service being addressed, the naming convention allows a shortened, unqualified form to be used instead of the fully qualified name, since the local namespace can be assumed rather than stated explicitly.


DNS for Headless Services

Resolving to Individual Pod Addresses

For a headless Service, defined without a cluster IP, the DNS definition changes: rather than resolving to a single virtual IP, a query resolves to the individual IP addresses of every backing Pod, which is what allows clients to discover and address specific replicas directly.


Pod DNS Records

An Optional, Narrower Case

Individual Pods can also be assigned DNS records, typically only when explicitly enabled and generally used in conjunction with a headless Service, since ordinary Pods are not expected to be addressed directly by name under the default DNS configuration.


What Cluster DNS Definition Excludes

Not a General-Purpose External Resolver

Cluster DNS is defined narrowly around resolving names for in-cluster objects; queries for domains outside the cluster's own naming convention are forwarded to an upstream resolver rather than being served directly by the cluster DNS service itself.


DNS Resolution Flow Diagram

Client query Cluster DNS Service/Pod IP