Diff

net/unbound.lua @ 13479:d1b7edf4e2de

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.
author Kim Alvefur <zash@zash.se>
date Sun, 14 Apr 2024 14:06:57 +0200
parent 12974:ba409c67353b
child 13659:5abdcad8c2e0
line wrap: on
line diff
--- 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;