mod_s2s: Add setting for overriding DNS resolvers (and avoid reading /etc/resolv.conf every time)
--- 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