Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Domain Names Validation - IDN Validation - Domain Names Validator - IDN Validator - TLD Validation - TLD Validator
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Domain Names Validation - IDN Validation - Domain Names Validator - IDN Validator - TLD Validation - TLD Validator

This class is a class to validate various domain names including IDN (international domain names)

1. I used idna_convert.class.php to convert from idna punnycode domain names to ascii domain names
IDNA stands for Internationalized Domain Names for Applications. It is a standard described in RFC 3490, RFC 3491 and RFC 3492. It is used to allow language specific characters in domain names, like the umlauts in German, accents in latin languages like French, or even chinese characters. 

This class allows you to convert domain names between the encoded Punycode notation and the decoded 8bit (UTF-8) notation. It simplifies the use of domain names defined with IDNA in applications or scripts.

2. All the domain naming rules were taken from 
- The right-most label conveys the top-level domain; for example, the domain name belongs to the top-level domain com.
- The hierarchy of domains descends from right to left; each label to the left specifies a subdivision, or subdomain of the domain to the right. For example: the label example specifies a subdomain of the com domain, and www is a sub domain of This tree of subdivisions may have up to 127 levels.
- Each label may contain up to 63 characters. The full domain name may not exceed a total length of 253 characters in its external dotted-label specification. In the internal binary representation of the DNS the maximum length requires 255 octets of storage. In practice, some domain registries may have shorter limits.[citation needed]
- DNS names may technically consist of any character representable in an octet. However, the allowed formulation of domain names in the DNS root zone, and most other sub domains, uses a preferred format and character set. The characters allowed in a label are a subset of the ASCII character set, and includes the characters a through z, A through Z, digits 0 through 9, and the hyphen. This rule is known as the LDH rule (letters, digits, hyphen). - - - -- Domain names are interpreted in case-independent manner. Labels may not start or end with a hyphen.
- A hostname is a domain name that has at least one IP address associated. For example, the domain names and are also hostnames, whereas the com domain is not.

3. All the valid TLD's were taken from 
Reference 1: 
Reference 2:

If you have any question feel free to email me at
Something went wrong with that request. Please try again.