diff --git a/nselib/dns.lua b/nselib/dns.lua
index 85462e596..4f74fd870 100644
--- a/nselib/dns.lua
+++ b/nselib/dns.lua
@@ -980,7 +980,7 @@ end
-- section 4.
--
-- entry.NSEC has the fields dname,
--- name, and types.
+-- next_dname, and types.
-- @param entry RR in packet.
-- @param data Complete encoded DNS packet.
-- @param pos Position in packet after RR.
@@ -989,7 +989,7 @@ decoder[types.NSEC] = function (entry, data, pos)
local block_num, type_bitmap
entry.NSEC = {}
entry.NSEC.dname = entry.dname
- np, entry.NSEC.name = decStr(data, np)
+ np, entry.NSEC.next_dname = decStr(data, np)
np, block_num, type_bitmap = bin.unpack(">Cp", data, np)
entry.NSEC.types = {}
for i in bit_iter(type_bitmap) do
diff --git a/scripts/dns-nsec-enum.nse b/scripts/dns-nsec-enum.nse
index dc63d280e..fcf8f073d 100644
--- a/scripts/dns-nsec-enum.nse
+++ b/scripts/dns-nsec-enum.nse
@@ -268,10 +268,10 @@ end
local function get_next_nsec(retPkt, domain)
for _, nsec in ipairs(auth_filter(retPkt, "NSEC")) do
-- The last NSEC record points backwards to the start of the subzone.
- if domain_lt(nsec.dname, domain) and not domain_lt(nsec.dname, nsec.name) then
+ if domain_lt(nsec.dname, domain) and not domain_lt(nsec.dname, nsec.next_dname) then
return nsec
end
- if domain_lt(nsec.dname, domain) and domain_lt(domain, nsec.name) then
+ if domain_lt(nsec.dname, domain) and domain_lt(domain, nsec.next_dname) then
return nsec
end
end
@@ -303,9 +303,9 @@ local function enum(host, port, domain)
subdomain = nil
break
end
- last, remainder = remove_suffix(nsec.name, domain)
+ last, remainder = remove_suffix(nsec.next_dname, domain)
if #remainder > 0 then
- stdnse.print_debug("Result name %q doesn't end in %q.", nsec.name, domain)
+ stdnse.print_debug("Result name %q doesn't end in %q.", nsec.next_dname, domain)
subdomain = nil
break
end