8

I looked up couple of questions on SO, which seem to suggest that two continuous hyphens (e.g. my--website.com) are not allowed but when I search for same domain name on http://www.register.com/index.rcmx, it gladly accepts the name while rejects non valid domain names like my#website.com.
Validation for URL/Domain using Regex? (Rails)

Community
  • 1
  • 1
RandomQuestion
  • 6,536
  • 16
  • 57
  • 94

3 Answers3

12

It's legal in a domain name, and required for internationalised domain names (IDNs) which when converted from Unicode to ASCII end up prefixed with xn--

Alnitak
  • 325,660
  • 70
  • 395
  • 481
6

In general double hyphens are allowed. However, in your specific example, it should not be possible, because they may not occur on the third and fourth position except when writing IDN labels in their xn-- notation. See the following section from 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).

Michael
  • 182
  • 1
  • 8
-1

It must be "allowed", regardless of the answers here, because https://hp--community.force.com exists. However, perhaps that's only okay because it's a subdomain of a registered domain, and not a registered domain in itself.

Dan
  • 9
  • 1
    I'm quite sure the rules for subdomains are different - and less restrictive - than the ones for domain names. – Jan Aagaard Jan 09 '20 at 08:26