Has anyone implemented sorting a list of domain names?
I have seen some applications sort them as flat strings, but the problem is that you end up scattering all the related hosts in a domain:
a.me.com a.you.com b.me.com b.you.com
So, the basic logic I came up with reverse the order of the labels, then sort.
FQDNs of one label should be treated as hostnames, and probably sorted separately, maybe at the top.
Ideally I am looking for javascript and java versions.
I also don't know if this design works well for the newer internationalized domain names.