public Name
canonicalize() {
	boolean canonical = true;
	for (int i = 0; i < name.length; i++) {
		if (lowercase[name[i] & 0xFF] != name[i]) {
			canonical = false;
			break;
		}
	}
	if (canonical)
		return this;

	Name newname = new Name();
	newname.appendSafe(name, offset(0), getlabels());
	for (int i = 0; i < newname.name.length; i++)
		newname.name[i] = lowercase[newname.name[i] & 0xFF];

	return newname;
}
Returns a canonicalized version of the Name (all lowercase).  This may be
the same name, if the input Name is already canonical.
src/main/java/core/org/xbill/DNS/Name.java