-
-
Save m0zgen/b64fe153101c451d55100a8aed1d1065 to your computer and use it in GitHub Desktop.
An example configuration to random selection between Quad9, Cloudflare and Google DNS-over-TLS for knot-resolver (kresd)
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
require 'math' | |
math.randomseed(os.time()) | |
dns_providers = { | |
{ -- Quad9 | |
{'9.9.9.9', hostname='dns.quad9.net', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'}, | |
{'149.112.112.112', hostname='dns.quad9.net', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'} | |
}, | |
{ -- Cloudflare | |
{'1.1.1.1', hostname='cloudflare-dns.com', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'}, | |
{'1.0.0.1', hostname='cloudflare-dns.com', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'} | |
}, | |
{'8.8.8.8', hostname='dns.google', ca_file='/usr/local/etc/kresd/GlobalSignR2CA.pem'}, | |
{'8.8.4.4', hostname='dns.google', ca_file='/usr/local/etc/kresd/GlobalSignR2CA.pem'} | |
} | |
} | |
policy.add(function (request, query) | |
return policy.TLS_FORWARD(dns_providers[math.random(1, #dns_providers)]) | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment