public boolean
subdomain(Name domain) {
	int labels = labels();
	int dlabels = domain.labels();
	if (dlabels > labels)
		return false;
	if (dlabels == labels)
		return equals(domain);
	return domain.equals(name, offset(labels - dlabels));
}
Is the current Name a subdomain of the specified name?
src/main/java/core/org/xbill/DNS/Name.java