22

Some people will reply that domain names are not case-sensitive. In the new Unicode world this is no longer true.

(Source)

I thought one of the steps in the Unicode > Punycode conversion was a "normalisation", which rendered domain names lower case.

Community
  • 1
  • 1
TRiG
  • 10,148
  • 7
  • 57
  • 107
  • See official spec (IETF RFC 4343): [Domain Name System (DNS) Case Insensitivity Clarification](http://tools.ietf.org/html/rfc4343) – Basil Bourque Nov 02 '13 at 22:26

2 Answers2

21

For old-fashioned ASCII-based domain names, Yes, domain names have been and continue to be case-insensitive.

To quote RFC 1035, DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION:

Note that while upper and lower case letters are allowed in domain names, no significance is attached to the case. That is, two names with the same spelling but different case are to be treated as if identical.

For example, all of these represent the same domain:

  • example.com
  • Example.com
  • EXAMPLE.COM
  • EXampLE.com

In modern DNS, we now have Internationalized Domain Names (IDN) which allows Unicode characters. The problem is that defining upper- and lowercase can be tricky in some languages and character sets beyond ASCII (Unicode is a superset of US-ASCII).

The intent of domain names is to be case-insensitive, but there may be complications with particular characters in particular scripts of particular human languages. So there is no simple YES or NO answer to your question.

If using non-ASCII domain names, you should read:

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
  • 1
    Additional detail + reference: [RFC 1035](https://www.rfc-editor.org/rfc/rfc1035) states "Note that while upper and lower case letters are allowed in domain names, no significance is attached to the case. That is, two names with the same spelling but different case are to be treated as if identical." – Kaan Jul 19 '22 at 22:12
  • @Kaan Thanks, I added that quote and link to the Answer. – Basil Bourque Jul 19 '22 at 22:21
0

WRONG: URLs are still case insensitive, even for IDN.


CORRECTION:

The question was about IDN: "Are IDN domain names case-sensitive?"

My initial answer is wrong, and does not clearly answer the question. It brings URLs into the mix.

The domain name part (IDN) of a URL is case-insensitive.

The other elements might be case-insensitive or not. It depends on many things, and in general is not predictable.

For instance the path part would normally depend on the OS or even the file system hosting the site (on MacOS you can format the drive as case insensitive or not) But these days you can have some of these paths "hooked" to answer RESTfull APIs. So it depends on how the "hook" is done.

Similar for other elements (user, password, parameters, parameter values)

Mihai Nita
  • 5,547
  • 27
  • 27
  • 1
    See RFC 3987 "Internationalized Resource Identifiers (IRIs)". They are case sensitive, but based on specific scheme they MAY be case insensitive. Domain part of IRI is case insensitive, but not other parts such as paths and filenames. – davispuh Apr 16 '14 at 18:12
  • The question is about IDN, not IRI. A domain name is just part of the IRI. Check RFC 3490. toASCII calls nameprep (RFC 3491) which refers stringprep (RFC 3454). Section 3.2 "Case folding" specifies the exact folding table (CaseFolding.txt) and the Unicode version (3.2) So not only that is case insensitive, but the exact case conversion table is specified. – Mihai Nita Apr 23 '14 at 08:01
  • 1
    So the approved answer is not accurate by saying "defining upper- and lowercase can be tricky in languages and character sets outside of ASCII". It is Unicode, and exact version specified. No other character sets. Even the Wikipedia article recommended by the "answer" say "apply the Nameprep algorithm, which converts the label to lowercase and performs other normalization". So please, before down-voting, do the homework. – Mihai Nita Apr 23 '14 at 08:01
  • 1
    URL are case sensitive. The way it usually goes in practice: path served by Linux servers (e.g. Apache) are case-sensitive (like the filesystem) while Windows servers (e.g. IIS) are NOT case-sensitive (like the windows filesystems). Your mileage may vary. – user5994461 Mar 06 '17 at 10:01
  • 3
    @user5994461. The question was specifically about domain names, not the entirety of the URL. I know that paths are case-sensitive per the HTTP spec, even if certain servers don't necessarily treat them as such. – TRiG Jul 27 '17 at 10:58