I'm ignoring the following facts in the calculations:
- The IDN system imposes additional restrictions on labels beginning with
xn--
, resulting in a reduction in the number of possible labels.
- Registries can impose arbitrary rules on domain registrations.
- In some cases, there are conflicting rules for domain names. For example, RFC 1035 2.3.1 forbids labels that begin with a digit, but the existence of
163.com
proves that .com doesn't adhere to that rule. (RFC 1035 is one of the oldest relevant RFCs, and many have come after it that make changes.)
- DNS can technically encode labels that contain arbitrary octets. However, common implementations only permit ASCII A-Z, a-z, 0-9, - (hyphen), and _ (underscore). Furthermore, A-Z and a-z are treated as equivalent. Since octets representing other characters would be unusual and present compatibility issues, I'm ignoring those.
- Some systems may impose restrictions on the first and/or last character of a label. I'm ignoring those.
Note that IDNs don't increase the number of possible domains--instead, IDNs decrease the number of possible domains. All IDNs have to be encoded to ASCII for use in DNS; that encoded form, Punycode, is subject to the same restrictions as non-IDNs. However, for a system to support Punycode, it has to impose additional restrictions on label beginning with
xn--
, thereby decreasing the number of possible labels.
Per character, that gives us 39 possibilities:
- 26: A-Z
- 10: 0-9
- 1: -
- 1: _
Labels can be up to 63 characters in DNS--that's the maximum length that can be encoded. Thus, for each length, we get:
- Length of 1: 39 possibilities
- Length of 2: 39^2 possibilities
- ...
- Length of 62: 39^62 possibilities
- Length of 63: 39^63 possibilities
If we sum those all up, we get 17715411840326414139418181731112699586559651152219815288474011280746308525590734354933147461703118079 possibilities for a single label. Conveniently, that's about 1.8
googol--just for a single TLD. If you're planning on registering that many domains, you might run into some difficulties.