Changeset

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
parents 13478:fe7557cf31a6
children 13480:3027c2634a44
files net/unbound.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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;