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?
A TLD's maximum length is 63 characters, although most are around 2–3. The full list of TLDs is maintained by ICANN.
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 .
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.
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.
DNS allows for a maximum of 63 characters for an individual label.
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:
wc
to count the longest lineAlternative using curl
thanks to Stefan:
curl -s http://data.iana.org/TLD/tlds-alpha-by-domain.txt | tail -n+2 | wc -L
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With