Domain Name Validator (RFC Compliance Check)
Check whether a domain name complies with the RFC 1035/1123 syntax rules. Validates label length, total length, allowed characters, and hyphen placement individually, showing the specific reason for any violation.
Tips
- This tool validates against the syntax rules defined in RFC 1035/1123; it does not check whether the domain is actually registered or resolvable via DNS.
- Before writing your own validation regex for a form, try this tool on the edge cases (exactly 63 characters, hyphen placement, etc.) to make sure your implementation covers them.
- Input containing non-ASCII characters, such as Japanese domain names, only skips the character-set check. Convert it to `xn--` notation with the Punycode converter first for a fully accurate check.
- An all-numeric TLD almost never happens in practice, but it is included intentionally to catch inputs that could be confused with an IP address during form validation.
- The same rule set can be applied to the part of an email address after the `@` sign, so it also doubles as a lightweight email domain check.
FAQ
Side Note — Why domain name validation keeps getting reinvented
Domain name syntax checking looks like it should be a single simple regular expression, yet it is an area where many developers have stumbled with their own implementations. From email validation in forms, to hostname parsing in config files, to URL validation in APIs, "domain-like strings" show up everywhere, but implementations that accurately reflect the official rules in RFC 1035 (1987) and RFC 1123 (1989) are surprisingly rare.
The two-tier length limit — 63 characters per label, 253 characters total — comes directly from the design of the DNS wire format (the binary format actually exchanged over the network). Each label is prefixed with a single length byte, and that byte is restricted to 0-63 (the maximum value representable in 6 bits), which is the direct reason for the label-length limit.
The convention that a TLD should not be all-numeric has an interesting history of its own. It is not a rule mandated by any RFC, but rather implementation wisdom widely adopted to distinguish domain names from IPv4 addresses (sequences of digits and dots). Many DNS resolvers and browsers use this convention to decide that a string like 192.168.1.1 should be treated as an IP address rather than a domain name.