-
-
Save da2x/36d440758e996b18c152891c83d4c731 to your computer and use it in GitHub Desktop.
policy.TLS_FORWARD to a random upstream DNS service provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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