# HG changeset patch # User Kim Alvefur # Date 1566049252 -7200 # Node ID 33f287519bf6a2699a019fe20f1a7f18be47f297 # Parent 756b8821007a12952705683dc274d186d567cb19 net.resolvers.service: Fix DNS fallback diff -r 756b8821007a -r 33f287519bf6 net/resolvers/service.lua --- a/net/resolvers/service.lua Sat Nov 10 13:37:32 2018 +0100 +++ b/net/resolvers/service.lua Sat Aug 17 15:40:52 2019 +0200 @@ -33,7 +33,11 @@ -- 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