diff --git a/nselib/dns.lua b/nselib/dns.lua
index 68668fbed..237bb4de1 100644
--- a/nselib/dns.lua
+++ b/nselib/dns.lua
@@ -204,7 +204,7 @@ local function processResponse( response, dname, dtype, options )
else
return findNiceAnswer(dtype, rPkt, options.retAll)
end
- else -- if not, ask the next server in authority
+ elseif ( not(options.noauth) ) then -- if not, ask the next server in authority
local next_server = getAuthDns(rPkt)
@@ -222,6 +222,8 @@ local function processResponse( response, dname, dtype, options )
options.tries = options.tries - 1
return query(dname, options)
end
+ elseif ( options.retPkt ) then
+ return true, rPkt
end
-- nothing worked
@@ -241,6 +243,7 @@ end
-- * retAll: Return all answers, not just the first.
-- * retPkt: Return the packet instead of using the answer-fetching mechanism.
-- * norecurse: If true, do not set the recursion (RD) flag.
+-- * noauth: If true, do not try to find authoritative server
-- * multiple: If true, expects multiple hosts to respond to multicast request
-- * flags: numeric value to set flags in the DNS query to a specific value
-- * id: numeric value to use for the DNS transaction id