List of all top level domains

user1826831 picture user1826831 · Jan 20, 2013 · Viewed 18.5k times · Source

I found a lot of threads explaining how to get the country-codes in two- or three-letter format, but nothing that fits to my task. I'm heading for a way to get all the top level domains in an array or something. I know there's the CultureInfo class in C# but which could list the country codes. It doesn't include generic TLD, e.g.: "com". Here's the complete list of country codes I found.

Answer

unor picture unor · Jan 21, 2013

The authoritative list of all TLDs: http://www.iana.org/domains/root/db

The Root Zone Database represents the delegation details of top-level domains, including gTLDs such as .com, and country-code TLDs such as .uk.

You can get this as TXT, too (easier to parse): http://data.iana.org/TLD/tlds-alpha-by-domain.txt


Wikipedia also lists all TLDs, but it's not authoritative, of course: List of Internet top-level domains


The Mozilla Foundation maintains a Public Suffix List for effective top-level domains, i.e., those under which you can directly register names (for example .co.uk instead of .uk): http://publicsuffix.org/