aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-03-02 16:02:42 +0000
committerMatthew Wild <mwild1@gmail.com>2022-03-02 16:02:42 +0000
commit79d9ce56ac6d6a09f0094c59c775e0e423be69bc (patch)
tree531b70842b7984a3c7df2bc79b80ccf5f6e32417 /util
parent7198c65a154445377ccefa4c54f48b7f956ae79b (diff)
downloadprosody-79d9ce56ac6d6a09f0094c59c775e0e423be69bc.tar.gz
prosody-79d9ce56ac6d6a09f0094c59c775e0e423be69bc.zip
prosodyctl: check dns: List discovered addresses for diagnostic purposes
It is very common to get the "unknown address" warning with this command, but people do not always understand it, or know how to debug it. Now we clearly show the addresses that prosodyctl discovered.
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl/check.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua
index 31adee8f..70f9e7b0 100644
--- a/util/prosodyctl/check.lua
+++ b/util/prosodyctl/check.lua
@@ -560,6 +560,8 @@ local function check(arg)
return (n:gsub("%.$", ""));
end
+ local unknown_addresses = set.new();
+
for jid, host_options in enabled_hosts() do
local all_targets_ok, some_targets_ok = true, false;
local node, host = jid_split(jid);
@@ -742,6 +744,7 @@ local function check(arg)
print(" "..target_host.." A record points to internal address, external connections might fail");
else
print(" "..target_host.." A record points to unknown address "..record.a);
+ unknown_addresses:add(record.a);
all_targets_ok = false;
end
end
@@ -760,6 +763,7 @@ local function check(arg)
print(" "..target_host.." AAAA record points to internal address, external connections might fail");
else
print(" "..target_host.." AAAA record points to unknown address "..record.aaaa);
+ unknown_addresses:add(record.aaaa);
all_targets_ok = false;
end
end
@@ -805,6 +809,18 @@ local function check(arg)
print("");
end
if not problem_hosts:empty() then
+ if not unknown_addresses:empty() then
+ print("");
+ print("Some of your DNS records point to unknown IP addresses. This may be expected if your server");
+ print("is behind a NAT or proxy. The unrecognized addresses were:");
+ print("");
+ print(" Unrecognized: "..tostring(unknown_addresses));
+ print("");
+ print("The addresses we found on this system are:");
+ print("");
+ print(" Internal: "..tostring(internal_addresses));
+ print(" External: "..tostring(external_addresses));
+ end
print("");
print("For more information about DNS configuration please see https://prosody.im/doc/dns");
print("");