# HG changeset patch # User Matthew Wild # Date 1646236962 0 # Node ID 8fc3c06f922d23b3d57c19884f8485c889d34423 # Parent 239ce74aa6a4a36c909f9b9b35eac52accb6d4da 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. diff -r 239ce74aa6a4 -r 8fc3c06f922d util/prosodyctl/check.lua --- a/util/prosodyctl/check.lua Wed Mar 02 15:45:24 2022 +0000 +++ b/util/prosodyctl/check.lua Wed Mar 02 16:02:42 2022 +0000 @@ -560,6 +560,8 @@ 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 @@ 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 @@ 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 @@ 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("");