+ if (!Conf_ServerName[0]) {
+ /* No server name configured, try to get a sane name from the
+ * host name. Note: the IRC server name MUST contain
+ * at least one dot, so the "node name" is not sufficient! */
+ gethostname(Conf_ServerName, sizeof(Conf_ServerName));
+ if (Conf_DNS) {
+ /* Try to get a proper host name ... */
+ h = gethostbyname(Conf_ServerName);
+ if (h)
+ strlcpy(Conf_ServerName, h->h_name,
+ sizeof(Conf_ServerName));
+ }
+ if (!strchr(Conf_ServerName, '.')) {
+ /* (Still) No dot in the name! */
+ strlcat(Conf_ServerName, ".host",
+ sizeof(Conf_ServerName));
+ }
+ Config_Error(LOG_WARNING,
+ "No server name configured, using host name \"%s\".",
+ Conf_ServerName);
+ }
+