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 | 91a0bce2b12a098408d7a67f77b5c42e9421e00b (patch) | |
tree | 714b94fd6fc34207dc2a3c716dd54558b77dc1e0 /net/resolvers | |
parent | 2b7a0e891a84b1af9b4b3387da4ce76811532c10 (diff) | |
download | prosody-91a0bce2b12a098408d7a67f77b5c42e9421e00b.tar.gz prosody-91a0bce2b12a098408d7a67f77b5c42e9421e00b.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 |