# Corefile
.:53{
forward . tls://1.1.1.1 tls://1.0.0.1 {
tls_servername cloudflare-dns.com
}
}
https://.:443 {
tls /etc/coredns/certs/domain.tld.crt /etc/coredns/certs/domain.tld.key
forward . 127.0.0.1
}
tls://.:853 {
tls /etc/coredns/certs/domain.tld.crt /etc/coredns/certs/domain.tld.key
forward . 127.0.0.1
}
$ docker run --rm -d --name coredns \
-p 443:443/tcp -p 853:853/tcp \
-v $PWD/Corefile:/etc/coredns/Corefile \
-v $PWD/domain.tld.crt:/etc/coredns/certs/domain.tld.crt \
-v $PWD/domain.tld.key:/etc/coredns/certs/domain.tld.key \
coredns/coredns:latest \
-conf /etc/coredns/Corefile
https://coredns.io/plugins/tls/