List of all top level domains [closed]
Asked Answered
J

2

19

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.

Jasun answered 20/1, 2013 at 18:33 Comment(3)
Do you mean top level domain names (TLDs)? Both the two-letter geographical TLDs and the non-geographical ones?Formulaic
Yes, I'm talking about the top level domain names. And yes, I need to get the geographical ones and the other ones.Jasun
Note: .com is not a country-code top-level domain (ccTLD), but a generic top-level domain (gTLD).Neoma
N
36

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/

Neoma answered 21/1, 2013 at 17:33 Comment(4)
See also tldextract, which handles this problem very well and uses Mozilla's PSL, as pointed out by @unor. It is in Python, but you may be able to glean the way it handles certain cases from its source code. (A win, because the problem domain is full of nuisances.)Poole
the txt file only lists the TLDs but not whether they are country-codes or not. Do you know of a list that either provides this information or lists just TLDs of country-codes?Islas
@IttayD: In case you missed it: the first link contains a table with the column "Type", where it says "country-code" for ccTLDs.Neoma
@unor: i didn't miss, but parsing html is a painIslas
L
11

I like to use this list (it includes private TLDs): http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1. To me it's the most complete list I could find and it's in a plain text format.

Lindahl answered 20/12, 2013 at 23:49 Comment(2)
A lot more useful, since it includes TLDs like .co.uk etcColorific
Looks like the link is dead now unfortunately.Schwaben

© 2022 - 2024 — McMap. All rights reserved.