[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC 2181: What is the maximum length of a domain name?



On the wire, the name is 1 to 255 octets, with the smallest being '0x00' in the first byte.

As far as printed ("conventional"), if you discount the escaped characters, you will have up to 254. I disagree with Peter about the trailing dot - that is included in a formal name. An API ought to allow for it because in some instances (e.g. DHCP options) it is allowed to include both partially-qualified and fully-qualified domain names.

If you allow for escaped characters, then you will multiple 254 by 4 and then subtract the minimum number of labels needed to fill up 255 octects worth of name. (A label can be only 64 octets long - including the length byte.)

So - len label len label len label len label len
1 63 1 63 1 63 1 61 1 (individ counts)
1 64 65 128 129 192 193 254 255 (cumulative to reach 255)
--- ----- --- ----- --- ----- --- ----- ---
value 63 ??? 63 ??? 63 ??? 61 ??? 0

It looks to me 4*(63+63+63+61)+5 = 1005 octets for the characters is possible (neglecting local encoding and the C-style terminating '\0').

On or before 21:18 +0200 4/30/03, someone wrote:
 Unfortunately, RFC 2181 "Clarifications to the DNS Specification"
 contradicts this:

 >   A full domain
 >   name is limited to 255 octets (including the separators).  The zero
 >   length full name is defined as representing the root of the DNS tree,
 >   and is typically written and displayed as ".".

 What is "The zero length full name"? The shortest possible name is just
 one byte long: a single zero byte. That's one byte, not zero bytes. You
 can't put a zero-byte name into a DNS packet.
Something to clean up when we shoot 2181 into Draft Standard.

I remember an old posting by Paul or Mark comparing the different encoding
levels (compressed/uncompressed wire format, text format, expanded text).
Maybe an Informational document on this would help. Fun will increase with IDN.
This is part of why I bristle at defining a standard "presentation" format. On the wire, 255 is 255 - no matter how you cook it up. Compression of messages doesn't change the syntactic representation, just how the transport is carried out. Once you go start worrying about the presentation (presented) format you get into a rat's nest.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Edward Lewis +1-703-227-9854
ARIN Research Engineer

It's true, my last college class really was "Introduction to Ada."

--
to unsubscribe send a message to namedroppers-request@ops.ietf.org with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/namedroppers/>