Software /
code /
prosody
Changeset
8896:739deb514140
mod_s2s: Add setting for overriding DNS resolvers (and avoid reading /etc/resolv.conf every time)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 03 Jun 2018 00:57:51 +0200 |
parents | 8895:d00ea07de9a0 |
children | 8902:ac21f13798ae |
files | plugins/mod_s2s/s2sout.lib.lua |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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