net.unbound: Show canonical name in textual format (e.g. in shell)
libunbound does not tell us the whole chain of CNAMEs, only the final
canonical name.
This is to aid in debugging since it will only be shown in the shell.
--- a/net/unbound.lua Mon Apr 08 16:44:11 2024 +0200
+++ b/net/unbound.lua Sun Apr 14 14:06:57 2024 +0200
@@ -80,8 +80,12 @@
h = h .. s_format(", Bogus: %s", self.bogus);
end
local t = { h };
+ local qname = self.canonname or self.qname;
+ if self.canonname then
+ table.insert(t, self.qname .. "\t" .. classes[self.qclass] .. "\tCNAME\t" .. self.canonname);
+ end
for i = 1, #self do
- t[i+1]=self.qname.."\t"..classes[self.qclass].."\t"..types[self.qtype].."\t"..tostring(self[i]);
+ table.insert(t, qname .. "\t" .. classes[self.qclass] .. "\t" .. types[self.qtype] .. "\t" .. tostring(self[i]));
end
local _string = t_concat(t, "\n");
self._string = _string;