How Long Can a Tld Possibly Be

How long can a TLD possibly be?

DNS allows for a maximum of 63 characters for an individual label.

Maximum length of a domain name without the http://www. & .com parts

Each label may contain up to 63 characters.

Is it possible to have one (single) character top level domain name?

It is technically possible, however, there are no single character tlds that have been accepted into the root (as of the moment) so the answer is:

Yes, it is possible to have single character for top level domain name, however, there are currently no single character TLDs in the root.

You can see the list of TLDs that are currently in the root at this URL:

  • http://data.iana.org/TLD/tlds-alpha-by-domain.txt

RFC-952 shows what a "name" is, this includes what is valid as a top level domain:

A "name" (Net, Host, Gateway, or Domain name) is a text string up
to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus
sign (-), and period (.).

Additionally, the grammar from RFC-952 shows:

 <name>  ::= <let>[*[<let-or-digit-or-hyphen>]<let-or-digit>]

RFC-1123 section 2.1 specifically allowed single letter domains & subdomains, changing the initial grammar of RFC-952 from starting with just a letter to being more relaxed, so now you are allowed to have single letter top level domains that are a number:

2.1  Host Names and Numbers

The syntax of a legal Internet host name was specified in RFC-952.
One aspect of host name syntax is hereby changed: the
restriction on the first character is relaxed to allow either a
letter or a digit. Host software MUST support this more liberal
syntax.

EDIT: As per @mr.spuratic's comment, RFC-3696 section 2 tightened the rules for top level domains, stating:

     There is an additional rule that essentially requires
that top-level domain names not be all-numeric.

This means that:

  • a. is a valid top level domain
  • 1. is not a valid top level domain

A very unscientific test of this shows that if I add "a" into my hosts file pointing to my local machine, going to http://a in my address bar does show my Apache welcome page.

List of standard lengths for database fields

W3C's recommendation:

If designing a form or database that will accept names from people
with a variety of backgrounds, you should ask yourself whether you
really need to have separate fields for given name and family name.

… Bear in mind that names in some cultures can be quite a lot longer
than your own. … Avoid limiting the field size for names in your
database
. In particular, do not assume that a four-character
Japanese name in UTF-8 will fit in four bytes – you are likely to
actually need 12.

https://www.w3.org/International/questions/qa-personal-names

For database fields, VARCHAR(255) is a safe default choice, unless you can actually come up with a good reason to use something else. For typical web applications, performance won't be a problem. Don't prematurely optimize.

Can a domain consist of only TLD (top level domain)?

Yes. Quick and dirty check:

$ for tld in $(wget -O- -q https://data.iana.org/TLD/tlds-alpha-by-domain.txt); do result=$(dig +short ${tld}. a); if [ -n "$result" ]; then echo "$tld $result"; fi; done

then, for example:
http://ai/

Number in the top-level domain?

Conceptually, there is nothing that disallows numbers in a TLD and in the future, who knows, perhaps there will be numeric TLDs.

There are no TLDs at the moment that do have numbers in them - the function probably does not test against a list of known TLDs (as it is subject to change), but lexically.

How to validate a domain name using Regex & PHP?

How about:

^(?:[-A-Za-z0-9]+\.)+[A-Za-z]{2,6}$

What is smallest valid domain name?

The other replies give you already some hints but I think they lack to separate two cases because your question is vague.

In fact I see 3 points:

  • what is technically valid, per the DNS syntax rules?
  • what can work today on the IANA root?
  • what works today from end clients, like browsers?

The first point is covered by Calle Dybedahl, technically . is the smallest label (or the empty label being diplayed as a dot). But this is not very useful just by itself.

To complete, each label of an hostname is 1 to 63 characters long. You can only choose between letters, digits and hyphen. Previously a label could not start with a digit but this restriction has been lifted long ago (otherwise 3com.com would not be possible). However the restriction remains of a label not starting with hyphen. So you can have a 1 character label/name/domain name being any letter (as in "ASCII" letters that is exclusively 'a' to 'z', case insensitive) or digit.
So this would be technically valid and in some lab experiment where you control the root zone you could have that.
(all the above is covered by RFC952 first and then amended by RFC1123 to remove restriction on first digit; they may be terse documents to read, a gentler introduction would be on Hostname entry in Wikipedia).
Note that there is a subtle distinction between hostnames and names in the DNS in general: a hostname is a name in a DNS but not all names are hostnames, as technically a name can have any byte content, whereas an hostname is restricted by the rules above (and is mostly what people will see in their day to day life on the Internet, where other names serve other infrastructure purposes)

Now, second point, the current IANA root and its content today. There are no one character names there today and I doubt there will be one day.
It starts with ccTLDs being 2 letters long. There is a process to add new gTLDs but they are basically at least 3 characters long (a little more complicated than that for IDNs, where there could be labels with 1 or 2 codepoints but through IDNA rules this will be a xn-- label so more than 4 characters long as seen in the DNS).
Also, not all two characters combinations are existing in the IANA root today, as they are ccTLDs, and hence must represent "current" country as their list is taken, loosely (they are exceptions) from the ISO list of country names (ISO 3166-1 Alpha2)

Noone can predict what would happen, but at least there is no space today for applications on one character TLDs.

tadman reply covered this point a little and the associated third point, what works today.
In fact, being one or two characters TLD you could see the same problem, often described as "dotless domain". For example https://dk/ resolves because the .DK TLD associated A/AAAA records to the label .dk.
This is possible in ccTLDs but not for gTLDs, as ICANN is strongly against that based on different reasons, one among them is that they work poorly, see this report for details: https://www.icann.org/en/system/files/files/sac-053-en.pdf
Note that they do not work poorly because of problems in the DNS protocol, just because various end clients OS/applications are used to automatically append a domain name suffix (or more than one) if the input has not "enough" dots, which is certainly true for a dotless domain name.

See RFC 7085 "Top-Level Domains That Are Already Dotless"
(December 2013) for a listing of all "dotless" cases (at that time), such as .DK, but they were 15 more. And even more if you count replies for MX DNS type.



Related Topics



Leave a reply



Submit