func CompareDomainName(s1, s2 string) (n int) {
	if s1 == "." || s2 == "." {
		return 0
	}
	l1 := Split(s1)
	l2 := Split(s2)
	j1 := len(l1) - 1  
	i1 := len(l1) - 2  
	j2 := len(l2) - 1
	i2 := len(l2) - 2
	if equal(s1[l1[j1]:], s2[l2[j2]:]) {
		n++
	} else {
		return
	}
	for {
		if i1 < 0 || i2 < 0 {
			break
		}
		if equal(s1[l1[i1]:l1[j1]], s2[l2[i2]:l2[j2]]) {
			n++
		} else {
			break
		}
		j1--
		i1--
		j2--
		i2--
	}
	return
}
CompareDomainName compares the names s1 and s2 and
returns how many labels they have in common starting from the *right*.
The comparison stops at the first inequality. The names are downcased
before the comparison.

www.miek.nl. and miek.nl. have two labels in common: miek and nl
www.miek.nl. and www.bla.nl. have one label in common: nl

s1 and s2 must be syntactically valid domain names.
package dns
func SplitDomainName(s string) (labels []string) {
	if len(s) == 0 {
		return nil
	}
	fqdnEnd := 0  
	idx := Split(s)
	begin := 0
	if IsFqdn(s) {
		fqdnEnd = len(s) - 1
	} else {
		fqdnEnd = len(s)
	}
	switch len(idx) {
	case 0:
		return nil
	case 1:
	default:
		for _, end := range idx[1:] {
			labels = append(labels, s[begin:end-1])
			begin = end
		}
	}
	return append(labels, s[begin:fqdnEnd])
}