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

前端 未结 3 717
Happy的楠姐
Happy的楠姐 2020-12-07 18:23

I\'m writing a Regex to validate email. The only one thing confuse me is:

Is it possible to have single character for top level domain name? (e.g.:

相关标签:
3条回答
  • 2020-12-07 18:54

    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.

    0 讨论(0)
  • 2020-12-07 18:59

    You should DEFINITELY allow 1-character domains since some registries allow them not by accident (and I speak of quite big registries like UK, Germany, Poland, Ireland too - so important contributors to the Internet community, not oney exotic small exceptions). Since I also plan using such domains, that definitely work also with all e-mail services I used, letters AND numbers, I really would give the hint to allow this, else your script might need later correction.

    Also some of the biggest internet companies use such domains - one of the most famous examples is Twitters t.co for shortening. Other companies I know of who have such domains are Facebook, Google, PayPal, Deutsche Telekom. But the list is longer and also some bigger investors hold them as assets.

    By the way as proof there is a website trading this kind of domains online if You search for "1 letter domain names" :)

    0 讨论(0)
  • 2020-12-07 19:08

    I'm not sure about the internet standard, but in practice, no.

    See,

    http://www.norid.no/domenenavnbaser/domreg.html

    and,

    http://sqa.fyicenter.com/Online_Test_Tools/Domain_Name_Format_Validator.php

    0 讨论(0)
提交回复
热议问题