---
title: "Add a zone to CoreDNS"
sidebar_label: "Add a zone to CoreDNS"
sidebar_position: 6
description: "How to add a custom zone to CoreDNS via ConfigMap"
---

import Formbricks from '@theme/MDXComponents/Formbricks'

# Add a zone to CoreDNS

To add a custom zone to the CoreDNS configuration in a cluster, use [ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/).

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

   ```yaml
   apiVersion: v1
   kind: ConfigMap
   metadata:
       name: coredns-custom
       namespace: kube-system
   data:
       test.custom: |
         example.com:53 {
           whoami
         }
   ```

2. Restart the CoreDNS pods:

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

<Formbricks />
