Securing CoreDNS
kube-dns was the default Domain Name System (DNS) server for a Kubernetes cluster. The DNS server helps internal objects such as services, pods, and containers locate each other. kube-dns is comprised of three containers, detailed as follows:
kube-dns: This container uses SkyDNS to perform DNS resolution services.dnsmasq: A lightweight DNS resolver. It caches responses from SkyDNS.sidecar: This monitors health and handles metrics reporting for DNS.
kube-dns has been superseded by CoreDNS since version 1.11 because of security vulnerabilities in dnsmasq and performance issues in SkyDNS. CoreDNS is a single container that provides all the functions of kube-dns.
To edit the configuration file for CoreDNS, you can use kubectl, like this:
$ kubectl -n kube-system edit configmap coredns
By default, the CoreDNS config file on Minikube looks like this:
# Please edit the object below. Lines beginning with a '#' # will be ignored...