aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-03 00:57:51 +0200
committerKim Alvefur <zash@zash.se>2018-06-03 00:57:51 +0200
commitd74f8ee65dc4b5bcb3716f1f3039e8017ef774a3 (patch)
tree45312adc4c3efae862a9e6c0da197372814dabc0 /plugins/mod_s2s
parentf6c0bff75f3ba21bdf72b9ff8b2577ed02a98a88 (diff)
downloadprosody-d74f8ee65dc4b5bcb3716f1f3039e8017ef774a3.tar.gz
prosody-d74f8ee65dc4b5bcb3716f1f3039e8017ef774a3.zip
mod_s2s: Add setting for overriding DNS resolvers (and avoid reading /etc/resolv.conf every time)
Diffstat (limited to 'plugins/mod_s2s')
-rw-r--r--plugins/mod_s2s/s2sout.lib.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_s2s/s2sout.lib.lua b/plugins/mod_s2s/s2sout.lib.lua
index 1225078f..a13eb8c9 100644
--- a/plugins/mod_s2s/s2sout.lib.lua
+++ b/plugins/mod_s2s/s2sout.lib.lua
@@ -31,6 +31,7 @@ local has_ipv4, has_ipv6;
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 @@ function s2sout.initiate_connection(host_session)
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