Skip to content

Custom DNS

This ConfigMap customizes the CoreDNS settings in a Kubernetes cluster. It defines static DNS entries and allows queries to fall through to the next plugin if no match is found.


# This ConfigMap is used to customize CoreDNS settings in a Kubernetes cluster.
# It defines static DNS entries and allows queries to fall through to the next plugin if no match is found.
# The ConfigMap is created in the kube-system namespace and can be used to override default CoreDNS behavior.
#
# Usage:
# - Define static DNS entries using the hosts plugin.
# - Use the fallthrough directive to allow unresolved queries to be handled by other plugins.
#
# Example:
# - 10.0.0.115 appname.domain.net: Maps the IP address 10.0.0.115 to the domain appname.domain.net.
# - fallthrough: Allows the query to continue to the next plugin if no answer is found.
#
apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-custom # This is the name of the ConfigMap you can overwrite with your changes
  namespace: kube-system # The namespace where the ConfigMap is created
data:
  appname.override: | # You may select any name here, but it must end with the .override file extension
    hosts { 
      10.0.0.115 appname.domain.net # Static DNS entry mapping
      fallthrough # Allows the query to continue to the next plugin if no answer is found
    }