# HG changeset patch # User Kim Alvefur # Date 1527980271 -7200 # Node ID 739deb514140ce9d4b4bb7128e5318e6f3a64cba # Parent d00ea07de9a04d334541e26b72c7fb0ae20435e2 mod_s2s: Add setting for overriding DNS resolvers (and avoid reading /etc/resolv.conf every time) diff -r d00ea07de9a0 -r 739deb514140 plugins/mod_s2s/s2sout.lib.lua --- a/plugins/mod_s2s/s2sout.lib.lua Fri Jun 08 23:03:34 2018 +0200 +++ b/plugins/mod_s2s/s2sout.lib.lua Sun Jun 03 00:57:51 2018 +0200 @@ -31,6 +31,7 @@ local dns_timeout = module:get_option_number("dns_timeout", 15); dns.settimeout(dns_timeout); +local resolvers = module:get_option_set("s2s_dns_resolvers") local s2sout = {}; @@ -50,6 +51,11 @@ host_session.version = 1; host_session.resolver = adns.resolver(); + if resolvers then + for resolver in resolvers do + host_session.resolver._resolver:addnameserver(resolver); + end + end -- Kick the connection attempting machine into life if not s2sout.attempt_connection(host_session) then