reasonable length of FQDN
Stefan Puiu
stefan.puiu at gmail.com
Wed Feb 1 13:22:15 UTC 2006
Thanks for the reply, I saw that explanation once in the BIND 9
headers, but then couldn't remember where to find it; I spent some
time looking for it.
I was looking for 1025 probably, and 'domain' and 'maximum' yield too
many results.
On 2/1/06, Mark Andrews <Mark_Andrews at isc.org> wrote:
>
> #define DNS_NAME_MAXTEXT 1023
> /*%<
> * The maximum length of the text representation of a domain
> * name as generated by dns_name_totext(). This does not
> * include space for a terminating NULL.
> *
> * This definition is conservative - the actual maximum
> * is 1004, derived as follows:
> *
> * A backslash-decimal escaped character takes 4 bytes.
> * A wire-encoded name can be up to 255 bytes and each
> * label is one length byte + at most 63 bytes of data.
> * Maximizing the label lengths gives us a name of
> * three 63-octet labels, one 61-octet label, and the
> * root label:
> *
> * 1 + 63 + 1 + 63 + 1 + 63 + 1 + 61 + 1 = 255
> *
> * When printed, this is (3 * 63 + 61) * 4
> * bytes for the escaped label data + 4 bytes for the
> * dot terminating each label = 1004 bytes total.
> */
>
> #define DNS_NAME_FORMATSIZE (DNS_NAME_MAXTEXT + 1)
> /*%<
> * Suggested size of buffer passed to dns_name_format().
> * Includes space for the terminating NULL.
> */
>
>
> > Also, there's an older post on this list that mentions 1004 as the
> > limit, quoting RFC1035 as the source (however, the number is not
> > explicitly mentioned in that document):
> >
> > http://groups.google.com/group/comp.protocols.dns.bind/browse_thread/thread/6
> > 36e8bba1ec6ca0d/c663e6f4b63f95d7?q=FQDN+length&rnum=3#c663e6f4b63f95d7
> >
> > On 2/1/06, Mark Andrews <Mark_Andrews at isc.org> wrote:
> > > From RFC 1035:
> > >
> > > To simplify implementations, the total number of octets that represent a
> > > domain name (i.e., the sum of all label octets and label lengths) is
> > > limited to 255.
> > >
> > >
> > > > TIA~
> > > >
> > > > --
> > > > Roman
> > > >
> > > >
> > > --
> > > Mark Andrews, ISC
> > > 1 Seymour St., Dundas Valley, NSW 2117, Australia
> > > PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews at isc.org
> > >
> > >
> > >
> >
> >
> --
> Mark Andrews, ISC
> 1 Seymour St., Dundas Valley, NSW 2117, Australia
> PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews at isc.org
>
More information about the bind-users
mailing list