RFC 952 [RFC0952] gives the specification for names that may be used
for host names on the Internet. It is updated by RFC 1123 [RFC1123],
which relaxes the specification somewhat. It is somewhat unclear
wheter the relaxation is per label or per entire host name.
In order to avoid problems based on lack of clarity, the
specification for a TLD name is hereby stated to be as follows:
A TLD label MUST be at least two characters long and MAY be as long
as 63 characters - not counting any leading or trailing periods (.).
It MUST consist of only ASCII characters from the groups "letters"
(A-Z), "digits" (0-9) and "hyphen" (-), and it MUST start with an
ASCII "letter", and it MUST NOT end with a "hyphen". Upper and lower
case MAY be mixed at random, since DNS lookups are case-insensitive.
Hence, the ABNF expression that matches a valid TLD label is as
tldlabel = ALPHA *61(ldh) ld
ldh = ld / "-"
ld = ALPHA / DIGIT
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
DIGIT = %x30-39 ; 0-9
This new specification reflects current praxis in registration of TLD
names by the IANA, and allows for IDNs.