# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1369138736 -3600
# Node ID a79c6717ee2bc7a352e0e7dc219a6638be0fa8b1
# Parent  b678868cf2d8fd495d27bf3aace0fde4436b6de6
prosodyctl: check config: Show a suggestion to change hosts that begin with jabber/xmpp/chat/im subdomains, and link to DNS documentation

diff -r b678868cf2d8 -r a79c6717ee2b prosodyctl
--- a/prosodyctl	Tue May 21 12:58:57 2013 +0100
+++ b/prosodyctl	Tue May 21 13:18:56 2013 +0100
@@ -820,7 +820,15 @@
 				print("");
 				print("    You need to move the following option"..(n>1 and "s" or "")..": "..table.concat(it.to_array(misplaced_options), ", "));
 			end
+			local subdomain = host:match("^[^.]+");
+			if not(is_component) and (subdomain == "jabber" or subdomain == "xmpp"
+			   or subdomain == "chat" or subdomain == "im") then
+			   	print("    Suggestion: If "..host.. " is a new host with no real users yet, consider renaming it now to");
+			   	print("     "..host:gsub("^[^.]+%.", "")..". You can use SRV records to redirect XMPP clients and servers to "..host..".");
+			   	print("     For more information see: http://prosody.im/doc/dns");
+			end
 		end
+		
 		print("Done.\n");
 	end
 	if not what or what == "dns" then