40 Kubernetes Cluster Domain Name New

The domain name system dns is a system for associating various types of information such as ip addresses with easy to remember names.
Kubernetes cluster domain name. Kubectl n kube system get configmap coredns o yaml. Kubernetes provides a robust level of dns support. Headless without a cluster ip services are also assigned a dns a or aaaa record depending on the ip family of the service for a name of the form my svc my namespace svc cluster domain example.
This is so that there is greater interoperability with workloads that relied on the legacy kube dns service name to resolve addresses internal to the cluster. By default most kubernetes clusters automatically configure an internal dns service to provide a lightweight mechanism for service discovery. For example if you have a pod with the fully qualified domain name busybox 1 default subdomain my namespace svc cluster domain example then by default the hostname command inside that pod returns busybox.
When a pod is configured to have fully qualified domain name fqdn its hostname is the short hostname. 53 kubernetes name of cluster local in addr arpa ip6 arpa. But what if we want to expose an app to the outside world as a website under a static domain.
I would like to resolve the kube dns names from outside of the kubernetes cluster by adding a stub zone to my dns servers. The request is sent to the configured custom dns resolver listening for example at 1 2 3 4. Luckily for us within a cluster we can reference pods by host name as defined in a spec.
You can deploy stuff your app running in the kubernetes cluster. For clusters that are using coredns for their dns the cluster name from kubeadm is also used as the domain suffix. The request is sent to kube dns.
Both the coredns and kube dns service are named kube dns in the metadata name field. This requires changing the cluster local domain to something that fits into my dns namespace. The sethostnameasfqdn feature gate must be enabled for the api server.