diff options
author | Kim Alvefur <zash@zash.se> | 2019-08-17 15:40:52 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-08-17 15:40:52 +0200 |
commit | 469ce79a49fabbe0d42115fa7a2f1a27e3bae3f1 (patch) | |
tree | 714b94fd6fc34207dc2a3c716dd54558b77dc1e0 /net/resolvers | |
parent | c788104e048f868c0448df797d2020fba1fa0934 (diff) | |
download | prosody-469ce79a49fabbe0d42115fa7a2f1a27e3bae3f1.tar.gz prosody-469ce79a49fabbe0d42115fa7a2f1a27e3bae3f1.zip |
net.resolvers.service: Fix DNS fallback
Diffstat (limited to 'net/resolvers')
-rw-r--r-- | net/resolvers/service.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/resolvers/service.lua b/net/resolvers/service.lua index d1b8556c..62d269e5 100644 --- a/net/resolvers/service.lua +++ b/net/resolvers/service.lua @@ -33,7 +33,11 @@ function methods:next(cb) -- Resolve DNS to target list local dns_resolver = adns.resolver(); - dns_resolver:lookup(function (answer) + dns_resolver:lookup(function (answer, err) + if not answer and not err then + -- net.adns returns nil if there are zero records or nxdomain + answer = {}; + end if answer then if #answer == 0 then if self.extra and self.extra.default_port then |