3

Is there a maximum length to DN's? If I want to store them in a database table, what would I set the length to?

Jerinaw
  • 5,260
  • 7
  • 41
  • 54
  • I searched stackoverflow before I posted, I couldn't find anything... I guess I couldn't think of another way to phrase what I was looking for. – Jerinaw Dec 04 '13 at 22:56

2 Answers2

4

I think the maximum length which is allowed is 255 characters.

Check MSDN

Name Length Limitations for LDAP Simple Bind Operations

During binds to the directory, simple LDAP bind operations limit the distinguished name (also known as DN) of the user to 255 total characters. If you attempt a simple LDAP bind with more than 255 characters, you might experience authentication errors

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
4

There is no defined maximum length of a distinguished name, or of an attribute value, in an LDAP-compliant server, though certainly there would be a practical limit because resources are finite. Non-compliant servers are whatever their designers build, of course.

Terry Gardner
  • 10,957
  • 2
  • 28
  • 38
  • I searched the specification before posting, I couldn't find a limit there. But I wasn't sure. – Jerinaw Dec 04 '13 at 22:59
  • 1
    @TerryGardner, could you refer to an authoritative source confirming that DNs are not intended to be limited in length?. I've been unable to find such a confirmation in standards like X.520 or RFC 5280. – Jaime Hablutzel Jul 09 '19 at 23:13