aboutsummaryrefslogtreecommitdiffstats
path: root/net/resolvers
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-08-17 15:40:52 +0200
committerKim Alvefur <zash@zash.se>2019-08-17 15:40:52 +0200
commit91a0bce2b12a098408d7a67f77b5c42e9421e00b (patch)
tree714b94fd6fc34207dc2a3c716dd54558b77dc1e0 /net/resolvers
parent2b7a0e891a84b1af9b4b3387da4ce76811532c10 (diff)
downloadprosody-91a0bce2b12a098408d7a67f77b5c42e9421e00b.tar.gz
prosody-91a0bce2b12a098408d7a67f77b5c42e9421e00b.zip
net.resolvers.service: Fix DNS fallback
Diffstat (limited to 'net/resolvers')
-rw-r--r--net/resolvers/service.lua6
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