diff options
author | Kim Alvefur <zash@zash.se> | 2018-06-03 00:57:51 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-06-03 00:57:51 +0200 |
commit | d74f8ee65dc4b5bcb3716f1f3039e8017ef774a3 (patch) | |
tree | 45312adc4c3efae862a9e6c0da197372814dabc0 /plugins/mod_s2s | |
parent | f6c0bff75f3ba21bdf72b9ff8b2577ed02a98a88 (diff) | |
download | prosody-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.lua | 6 |
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 |