I recently wanted to write some code that analyzed URLs to determine if the source was the same– eliminating sub-domains. For something simple like “sensiblesoftware.com” or “www.sensiblesoftware.com”, this is easy. However, what about othes countries? Something like “www.company.co.uk” or “company.co.uk”? It was clear I needed a list. Initially, I went and found the TLD/Top Level Domain list at the ICANN. It was clear by just looking at this, however, that it didn’t include individual country’s second level domains, such as “.co.uk”. This makes it difficult to use for getting the effective organization domain(which would be the ‘company’ in company.com or company.co.uk).

After looking, I eventually found a list of these, but it wasn’t formatted very nicely for use in programming, so I formatted it and I’m providing the list here– you can easily copy/paste this list into a text file for programmatic use.