How many consecutive hyphens can you have in a domain name? – Terence Eden’s Blog
Theme Switcher:
🌒 Dark
🌞 Light
📰 eInk
💻 xterm
🥴 Drunk
👻 Nude
♻️ Reset
A seemingly simple question which sent me down into the murky depths of standards. How many consecutive hyphens can you have in a domain name? It probably isn't sensible to name your online presence a----------hyphen.com - but is there anything technically stopping you?
History
Let's do some history!
This is 1978's "HOST NAMES ON-LINE". Early Internet standards described the - character as "minus" rather than hyphen.
RFC 608
up to 48 characters drawn from the alphabet (A-Z),
digits (0-9), and the minus sign (-) ... specifically, no blank or space characters allowed;
no distinction between upper and lower case letters;
the first character is a letter;
the last character is NOT a minus sign;
no other restrictions on content or syntax.
So, originally, you could have as many hyphens as you wanted after the first symbol - which had to be a letter. The last symbol had to be a letter or number0.
That was later formalised in 1981's "DoD INTERNET HOST TABLE SPECIFICATION"
RFC 810 GRAMMATICAL HOST TABLE SPECIFICATION
::= [*[]]
That's carried in the the slightly more modern RFC 952.
By the time we hit 1987, the word "minus" has gone. Note, there are no restrictions on the number of hyphens - just as long as your domain name doesn't start or end with one1.
RFC 1035 2.3.1. Preferred name syntax
The labels must follow the rules for ARPANET host names. They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen.
By 1989, the "DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION" was tweaked again:
RFC 1123 2. GENERAL ISSUES
The syntax of a legal Internet host name was specified in RFC-952. One aspect of host name syntax is hereby changed: the restriction on the first character is relaxed to allow either a letter or a digit. Host software MUST support this more liberal syntax.
And, from then on, things stayed pretty stable until the futuristic year 2010. That was when Internationalised Domain Names (IDN) became available. They use the xn-- string at the start of the name so, the spec now says:
RFC 5891 4.2.3.1. Hyphen Restrictions
The Unicode string MUST NOT contain "--" (two consecutive hyphens) in the third and fourth character positions and MUST NOT start or end with a "-" (hyphen).
What they really mean is that "--" is banned in position 3 & 4 unless the first two characters are "xn"2.
So, in theory, you can have up to 59 consecutive hyphens by ensuring that they start in position 4 and end at position 62.
Something like abc---[…]---z.com should be fine.
OR IS IT?!?!?
TLD Restrictions
There's what the RFC's say, and what a Top Level Domain (TLD) will allow. The Registry (the organisation which administers the TLD) may set their own, more restrictive, policies. Some will ban naughty words, or refuse IDN registrations, or prevent impersonation of Public Suffix domain, etc.
For example, South Sudan's .ss policies refuse to allow any hyphens.
Nominet, who run the .uk Registry, don't have any restrictions on the use of hyphens other than refusing to register xn-- domains.
But, in general, you can register multi-hyphened domain names with most Registries.
Anomalies
Of course, the mighty Internet mostly runs on spit and hope3. Naturally there are going to be mistakes, glitches, exceptions, and anomalies.
My delightful friend Q Misell had a rummage through her archives and helped track down some of the domain names which violate the modern rules. It's somewhat difficult to query every domain name, nevertheless, there are hundreds of multi-hyphened domains lurking within DNS.
Some, like ok--computer.com are long dead, but some are still active4!
Possibly the most consecutive hyphens belongs to http://a-------------------------------------------------------------a.com/
Sixty-one hyphens! The maximum possible, and it still works! The website looks like it hasn't been updated since it was first registered in 2000.
But what about more modern domains? The spookily named http://zz--icann-monitoring.uk/ was registered in 2024 - long after the rules were updated. But as Nominet doesn't allow xn-- domains, I guess it is fine?
There are some domains like bq--3bhauz7frjrgbka.com which look like they were pseudo-randomly generated. Perhaps as command-and-control servers?
Here's a quick table showing some of the ones Q found:
Domain<br>Creation...