Created
July 19, 2025 16:54
-
-
Save st3fan/ae6b0a56b222bc2a1eb6f10680b1e261 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-- Define backend pools | |
newServer{address="tls://8.8.8.8", pool="google", tlsHostname="dns.google"} | |
newServer{address="tls://8.8.4.4", pool="google", tlsHostname="dns.google"} | |
newServer{address="tls://1.1.1.1", pool="cloudflare", tlsHostname="cloudflare-dns.com"} | |
newServer{address="tls://1.0.0.1", pool="cloudflare", tlsHostname="cloudflare-dns.com"} | |
-- Define local listeners | |
addLocal("127.0.0.1:5301", {pool="google"}) | |
addLocal("127.0.0.1:5302", {pool="cloudflare"}) | |
addLocal("0.0.0.0:53") -- Main listener | |
-- Main listener will round-robin to both upstream pools via custom routing | |
function mainRouter(dq) | |
-- Round-robin or custom logic | |
if math.random() < 0.5 then | |
dq:setPool("google") | |
else | |
dq:setPool("cloudflare") | |
end | |
return DNSAction.None | |
end | |
setServerPolicy("leastOutstanding") -- or "firstAvailable", "roundrobin", etc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment