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 | 40a8bf5766ce4ebca9edaf38c53cadff0451f559 (patch) | |
tree | 45312adc4c3efae862a9e6c0da197372814dabc0 | |
parent | 80d38b263d360ddf6673bde3ccb4f5a445f8bc9e (diff) | |
download | prosody-40a8bf5766ce4ebca9edaf38c53cadff0451f559.tar.gz prosody-40a8bf5766ce4ebca9edaf38c53cadff0451f559.zip |
mod_s2s: Add setting for overriding DNS resolvers (and avoid reading /etc/resolv.conf every time)
-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 |