[jcifs] Problem with jcifs.UniAddress.isValidDnsName(String)

Spierenburg, Peter peter.spierenburg at abridean.com
Thu Oct 6 20:40:32 GMT 2005

There appears to be a bug in the jcifs.UniAddress.isValidDnsName(String)
method. As it stands in the 1.2.5 release, this method rejects dns names
which begin with a digit. This is unfortunate since digits are permitted
first characters in dns names. As a result, I propose changing the
method to use a regular expression:
import java.util.regex.Pattern;
static boolean isValidDnsName( String hostname ) {
    Pattern p =
    return p.matcher(hostname).matches();

which I believe more accurately expresses the nature of dns names.

Does this seem reasonable?
Peter-Frank Spierenburg.
-------------- next part --------------
HTML attachment scrubbed and removed

More information about the jcifs mailing list