Skip to content

Commit

Permalink
feat(dns): only use the nameservers from opts if provided.
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <[email protected]>
  • Loading branch information
zhaojh329 committed Mar 20, 2024
1 parent d2ec6a3 commit e38098d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,10 @@ function M.query(qname, opts)
return nil, err
end

for _, nameserver in ipairs(resolvconf.nameservers) do
nameservers[#nameservers + 1] = nameserver
if #nameservers == 0 then
for _, nameserver in ipairs(resolvconf.nameservers) do
nameservers[#nameservers + 1] = nameserver
end
end

if #nameservers < 1 then
Expand Down

0 comments on commit e38098d

Please sign in to comment.