This attempts to extract the top-level domain name from a fully-qualified name. It recognizes the third-level domain structure commonly used by the .uk TLD, extracts only the 2LD.TLD from the common legacy TLDs (com, net, org, etc.). It will undoubtedly need some care and feeding as new TLDs become more prevalent. :-(