Skip to main content

Add a zone to CoreDNS

To add a custom zone to the CoreDNS configuration in the cluster, use a ConfigMap.

  1. Create a manifest for the ConfigMap. Specify the name coredns-custom and the namespace kube-system. The name of the file created via the ConfigMap must end with the suffix .custom. Manifest example:

    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: coredns-custom
    namespace: kube-system
    data:
    test.custom: |
    example.com:53 {
    whoami
    }
  2. Restart the CoreDNS pods:

    kubectl delete po -n kube-system -l k8s-app=kube-dns