Skip to content

Instantly share code, notes, and snippets.

@da2x

da2x/kresd.conf Secret

Created April 2, 2018 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save da2x/36d440758e996b18c152891c83d4c731 to your computer and use it in GitHub Desktop.
Save da2x/36d440758e996b18c152891c83d4c731 to your computer and use it in GitHub Desktop.
policy.TLS_FORWARD to a random upstream DNS service provider
math.randomseed(os.time())
tls_ca_bundle = '/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem'
dns_providers = {
{
{'9.9.9.9', hostname='dns.quad9.net', ca_file=tls_ca_bundle},
{'2620:fe::fe', hostname='dns.quad9.net', ca_file=tls_ca_bundle},
{'149.112.112.112', hostname='dns.quad9.net', ca_file=tls_ca_bundle}
},
{
{'1.1.1.1', hostname='cloudflare-dns.com', ca_file=tls_ca_bundle},
{'2606:4700:4700::1111', hostname='cloudflare-dns.com', ca_file=tls_ca_bundle},
{'1.0.0.1', hostname='cloudflare-dns.com', ca_file=tls_ca_bundle},
{'2606:4700:4700::1001', hostname='cloudflare-dns.com', ca_file=tls_ca_bundle}
}
}
policy.add(policy.all(policy.TLS_FORWARD(dns_providers[math.random(#dns_providers)])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment