#ifndef lint
#if NAMED_BIND
-static char sccsid[] = "@(#)domain.c 8.43 (Berkeley) %G% (with name server)";
+static char sccsid[] = "@(#)domain.c 8.44 (Berkeley) %G% (with name server)";
#else
-static char sccsid[] = "@(#)domain.c 8.43 (Berkeley) %G% (without name server)";
+static char sccsid[] = "@(#)domain.c 8.44 (Berkeley) %G% (without name server)";
#endif
#endif /* not lint */
loopcnt = 0;
cnameloop:
- for (cp = host, n = 0; *cp; cp++)
+ for (cp = host, n = 0; *cp != '\0'; cp++)
if (*cp == '.')
n++;
}
*dp = NULL;
+ /* if we have a wildcard MX and no dots, try MX anyhow */
+ if (n == 0)
+ trymx = TRUE;
+
/*
** Now run through the search list for the name in question.
*/
}
}
- if (mxmatch != NULL)
- {
- /* we matched before -- use that one */
- break;
- }
-
- /* otherwise, try the next name */
+ /* try the next name */
dp++;
qtype = T_ANY;
continue;
{
case T_MX:
gotmx = TRUE;
- if (**dp != '\0')
+ if (**dp != '\0' || !HasWildcardMX)
{
/* got a match -- save that info */
if (trymx && mxmatch == NULL)