Domain Name Format Validator

As a software developer or tester of Web applications, you may be required to know what is a valid domain name and what is an invalid domain name. A valid domain name must satisfy a number of requirements. This page allows you to learn and test domain name format again those requirements.

What is a valid domain name?

A domain name is an identification of a unique computer system on the Internet. A complete domain name consists of one or more subdomain names and one top-level domain name separated by dots (.). For example, is a complete domain name.

A complete domain name is valid if it meets the following criteria:

  • A complete domain name must have one or more subdomain names and one top-level domain name.
  • A complete domain name must use dots (.) to separate domain names.
  • Domain names must use only alphanumeric characters and dashes (-).
  • Domain names must not begin or end with dashes (-).
  • Domain names must mot have more than 63 characters.
  • The top-level domain name must be one of the predefined top-level domain names, like (com), (org), or (ca)

How to test domain name format?

In order to help your programming or testing tasks, has designed this online testing page for you to validate any given domain name using PHP regular expressions.

All you need to do is to enter a domain name in the form below and click the Start button.

Domain Name:

Popup Windows Tutorials

20 tutorials on different ways to create and test popup windows created in JavaScript: Page unload popups, Pop re-open on close, ...

200+ PHP Script Tutorials

Each tutorial answers one commonly asked PHP programming question with a short, but precise and clear PHP script.