aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2024-04-14 14:06:57 +0200
committerKim Alvefur <zash@zash.se>2024-04-14 14:06:57 +0200
commitf29bc1c119de49b053e8bbbc0070f7f9a95bdfe0 (patch)
tree1c6541c93319509d5573425e820829da3f40153a /net
parent04a918233e6fbd0749779d6ff90b4a43fc7d5a21 (diff)
downloadprosody-f29bc1c119de49b053e8bbbc0070f7f9a95bdfe0.tar.gz
prosody-f29bc1c119de49b053e8bbbc0070f7f9a95bdfe0.zip
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.
Diffstat (limited to 'net')
-rw-r--r--net/unbound.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/unbound.lua b/net/unbound.lua
index c3ccb9ea..176a6156 100644
--- a/net/unbound.lua
+++ b/net/unbound.lua
@@ -80,8 +80,12 @@ local answer_mt = {
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;