Getting Information About Your Default CoreDNS Configuration

CoreDNS is the DNS server deployed in OKS clusters that is responsible for resolving service names within clusters.

The default CoreDNS configuration is managed by OKS and may be automatically updated during cluster upgrades or maintenance operations. As a result, manual modifications to the default CoreDNS configuration may be overwritten.

OKS provides a dedicated ConfigMap to extend CoreDNS while preserving customizations during cluster updates. For more information, see Tutorial: Customizing Your CoreDNS Configuration.

Before you begin:

Your default CoreDNS configuration is stored in a ConfigMap named coredns in the kube-system namespace.

You can retrieve it using the following command:

Request sample
$ kubectl get configmap -n kube-system coredns -o yaml
Result sample
apiVersion: v1
data:
  Corefile: |-
    .:53 {
        errors
        health {
            lameduck 10s
        }
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
            pods insecure
            fallthrough in-addr.arpa ip6.arpa
            ttl 30
        }
        prometheus 0.0.0.0:9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
        import /custom/*.include
    }

    import /custom/*.server
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: coredns
    meta.helm.sh/release-namespace: kube-system
  name: coredns
  namespace: kube-system

The import /custom/*.include and import /custom/*.server directives allow CoreDNS to load additional configuration files, enabling users to extend the default configuration without modifying the managed CoreDNS ConfigMap.

Related Pages