Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How long can a TLD possibly be?

I'm working on an email validation regex in PHP and I need to know how long the TLD could possibly be and still be valid. I did a few searches but couldn't find much information on the topic. So how long can a TLD possibly be?

like image 476
HellaMad Avatar asked Feb 11 '12 07:02

HellaMad


People also ask

How long can a TLD be?

A TLD's maximum length is 63 characters, although most are around 2–3. The full list of TLDs is maintained by ICANN.

Does your TLD matter?

There are so many options you can choose from when setting up a website, does TLD even matter? It does. While Google says the choice of TLD doesn't impact your keyword rankings, it could impact your overall traffic. For example, if you want to register a domain but the .com option isn't available, and you opt for .

Can anyone create a TLD?

Any established public or private organization anywhere in the world can apply to create and operate a new generic Top-Level Domain (gTLD) registry. Applicants will need to demonstrate the operational, technical and financial capability to run a registry and comply with additional specific requirements.

What is full TLD?

A TLD (top-level domain) is the most generic domain in the Internet's hierarchical DNS (domain name system). A TLD is the final component of a domain name, for example, "org" in developer.mozilla.org . ICANN (Internet Corporation for Assigned Names and Numbers) designates organizations to manage each TLD.


2 Answers

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

like image 122
tripleee Avatar answered Oct 04 '22 04:10

tripleee


The longest TLD currently in existence is 24 characters long, and subject to change. The maximum TLD length specified by RFC 1034 is 63 octets.

To get the length of the longest existing TLD:

wget -qO - http://data.iana.org/TLD/tlds-alpha-by-domain.txt | tail -n+2 | wc -L 

Here's what that command does:

  1. Get the latest list of actual existing TLDs from IANA
  2. Strip the first line, which is a long-ish comment
  3. Launch wc to count the longest line

Alternative using curl thanks to Stefan:

curl -s http://data.iana.org/TLD/tlds-alpha-by-domain.txt | tail -n+2 | wc -L 
like image 22
Dan Dascalescu Avatar answered Oct 04 '22 03:10

Dan Dascalescu