5

Just curious technically what is valid domain name

t. <- is that valid

localhost is valid

I remember reading something very short without even two words

0

3 Answers 3

5

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.

7
  • so practically .dk - two letters are smallest possible. Commented Mar 4, 2018 at 19:06
  • thanks really appreciate it, would have no clue where to start reading up on this if i reaaaly wanted to know Commented Mar 4, 2018 at 19:07
  • @MuhammadUmer this page could be a good introduction with many pointers if more curious: en.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax Commented Mar 4, 2018 at 19:18
  • It seems to be a work in progress, and I am certainly not an expert - merely aware it exists - but there can be non-ASCII characters in domain names. This seems like the sort of question someone trying to write a RegEx would try to do to match either domain names or emails. That's a really bad idea if that's what's going on, unless you settle for ".+@.+" for email and ".+" for domains.
    – Walt
    Commented Jul 25, 2022 at 14:59
  • 1
    @GillesQuénot Swap it for ai then :-) (only A, no AAAA, so old-school...) Commented May 22 at 0:42
3

The shortest possible valid name in DNS is the name of the root zone, which consists of a single octet where all bits are zero. It is usually written out for humans as a . character or as an empty string.

2
  • so space dot is valid, does that mean a. is also valid Commented Mar 3, 2018 at 18:52
  • Yes, and I have seen it used on an isolated intranet. However, you will not get ICANN to accept in the normal public DNS tree. So at this point you have to decide what you mean by "valid", because there is a huge difference between what works technically and what is allowed by policy.
    – user3967089
    Commented Mar 5, 2018 at 8:24
0

Technically t is valid if your DNS resolver considers it valid, but getting that to be universally valid is the hard part.

If you can get ICANN to approve a single letter gTLD then yes one letter is the shortest. Until then it's two.

4
  • Some two letter ccTLDs have had A records on occasion, so that would be valid, though this is not normally the case. It's technically possible to have t. be a domain name, though ARIN hasn't issued one yet. The shortest working URL I've seen is for http://ai. where the . is only necessary because not having a dot somewhere in the address confuses browsers.
    – tadman
    Commented Mar 3, 2018 at 20:41
  • The fact of having an A record of not is not was make it valid or not. Domain names have necessarily NS and SOA records attached to them. Commented Mar 4, 2018 at 17:37
  • https://ab./ is syntaxically valid but may not work (.ab is not a valid ccTLD and even if it were, it might not have A/AAAA records; note that you can technically put a dot at the end of any hostname, including in an URL, but many webservers/applications do not handle this correctly); https://.ab/ is not syntaxically valid and will never work. Commented Mar 4, 2018 at 18:27
  • @PatrickMevzek I mean more from the "can I load this in a browser" sort of valid than on an RFC specification level. The RFC for DNS doesn't say you can't have x as a gTLD, but it does say you can't have just - as one.
    – tadman
    Commented Mar 4, 2018 at 20:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.