Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Cloudflare 1.1.1.1 with Kubernetes DNS

I'd like to use Cloudflare's 1.1.1.1 and 1.0.0.1 nameservers in Kubernetes, alongside DNS over TLS. It looks like I can do it using core-dns. I need to setup the following somehow:

  • IPv4: 1.1.1.1 and 1.0.0.1
  • IPv6: 2606:4700:4700::1111 and 2606:4700:4700::1001
  • TLS Server Name: tls.cloudflare-dns.com

What should my ConfigMap look like? I've started it below:

apiVersion: v1
kind: ConfigMap
data:
  upstreamNameservers: |
    ["1.1.1.1", "1.0.0.1"]
like image 335
Muhammad Rehan Saeed Avatar asked Feb 04 '19 09:02

Muhammad Rehan Saeed


People also ask

Does Cloudflare support DNS over https?

1.1 supports DNS over TLS (DoT) and DNS over HTTPS (DoH), two standards developed for encrypting plaintext DNS traffic.


1 Answers

You can configure your core-dns kubectl -n kube-system edit configmap coredns and add to end of corefile:

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

and than save new configuration and restart core-dns pods.

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

like image 138
Nick Rak Avatar answered Sep 19 '22 20:09

Nick Rak