<p>I'd like to use Cloudflare's <a href="https://1.1.1.1/" rel="noreferrer">1.1.1.1 and 1.0.0.1</a> nameservers in Kubernetes, alongside <a href="https://developers.cloudflare.com/1.1.1.1/dns-over-tls/" rel="noreferrer">DNS over TLS</a>. It <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/" rel="noreferrer">looks like</a> I can do it using <a href="https://github.com/coredns/coredns/issues/1650" rel="noreferrer">core-dns</a>. I need to setup the following somehow:</p>

<ul>
<li>IPv4: <code>1.1.1.1</code> and <code>1.0.0.1</code></li>
<li>IPv6: <code>2606:4700:4700::1111</code> and <code>2606:4700:4700::1001</code></li>
<li>TLS Server Name: <code>tls.cloudflare-dns.com</code></li>
</ul>

<p>What should my <code>ConfigMap</code> look like? I've started it below:</p>

<pre><code>apiVersion: v1
kind: ConfigMap
data:
  upstreamNameservers: |
    ["1.1.1.1", "1.0.0.1"]
</code></pre>

Muhammad Rehan Saeed
<p>You can configure your core-dns <code>kubectl -n kube-system edit configmap coredns</code>
and add to end of corefile:</p>

<pre><code>. {
    forward . tls://1.1.1.1 tls://1.0.0.1 {
       tls_servername cloudflare-dns.com
       health_check 5s
    }
    cache 30
}
</code></pre>

<p>and than save new configuration and restart core-dns pods.</p>

<pre><code>kubectl get pod -n kube-system | grep core-dns | cut -d " " -f1 - | xargs -n1 -P 10 kubectl delete pod -n kube-system

</code></pre>
