Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

reasonable length of FQDN

5 views
Skip to first unread message

Roman Mashak

unread,
Feb 1, 2006, 12:36:59 AM2/1/06
to
Hello,

what may be the reasonable length of fully-quialilfied domain name
that can be set up in application? I'd wish this length would cover
possible user desires and at the same time wouldn't violate standard.

TIA~

--
Roman


Mark Andrews

unread,
Feb 1, 2006, 12:50:28 AM2/1/06
to

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_A...@isc.org


Stefan Puiu

unread,
Feb 1, 2006, 3:14:15 AM2/1/06
to
Mark, isn't that the maximum length of the wire representation of a
domain name? arpa/nameser.h in libbind defines NS_MAXDNAME to be 1025,
with the comment 'maximum domain name', while NS_MAXCDNAME is defined
as 255 with the comment 'maximum compressed domain name'. I've always
wondered where the 1025 came from.

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/636e8bba1ec6ca0d/c663e6f4b63f95d7?q=FQDN+length&rnum=3#c663e6f4b63f95d7

Stephane Bortzmeyer

unread,
Feb 1, 2006, 4:07:50 AM2/1/06
to
On Wed, Feb 01, 2006 at 04:50:28PM +1100,
Mark Andrews <Mark_A...@isc.org> wrote
a message of 25 lines which said:

> 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.

If the OP said "reasonable" and not "legal", I believe it is because
he have already read the RFC and wanted a more operational answer :-)

For instance, mtr, by default, truncates the FQDN at the first 33
characters for display. This is probably the sort of things the OP had
in mind.

Another example is that the longest domain name in ".fr", far from the
theoretical limit (but it hits the limit for a label), is
bolognaise-cannes-moulinets-soies-culdecanard-mouches-flotteurs.fr (68
characters) and
www.bolognaise-cannes-moulinets-soies-culdecanard-mouches-flotteurs.fr
works :-)


Mark Andrews

unread,
Feb 1, 2006, 7:49:16 AM2/1/06
to

> Mark, isn't that the maximum length of the wire representation of a
> domain name?

Yes. All other lengths are derived from that.

> arpa/nameser.h in libbind defines NS_MAXDNAME to be 1025,
> with the comment 'maximum domain name', while NS_MAXCDNAME is defined
> as 255 with the comment 'maximum compressed domain name'. I've always
> wondered where the 1025 came from.

#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_A...@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.
> >
> >

Mark Andrews

unread,
Feb 1, 2006, 7:55:56 AM2/1/06
to

> On Wed, Feb 01, 2006 at 04:50:28PM +1100,
> Mark Andrews <Mark_A...@isc.org> wrote
> a message of 25 lines which said:
>
> > 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.
>
> If the OP said "reasonable" and not "legal", I believe it is because
> he have already read the RFC and wanted a more operational answer :-)

There are plenty of real world hostnames that are 253 characters
long. People like to have fun. :-)



> For instance, mtr, by default, truncates the FQDN at the first 33
> characters for display. This is probably the sort of things the OP had
> in mind.
>
> Another example is that the longest domain name in ".fr", far from the
> theoretical limit (but it hits the limit for a label), is
> bolognaise-cannes-moulinets-soies-culdecanard-mouches-flotteurs.fr (68
> characters) and
> www.bolognaise-cannes-moulinets-soies-culdecanard-mouches-flotteurs.fr
> works :-)

--

Stefan Puiu

unread,
Feb 1, 2006, 8:22:15 AM2/1/06
to
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.

> > > 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

Christian Smith

unread,
Feb 1, 2006, 7:19:10 AM2/1/06
to
In article <drphne$cog$1...@sf1.isc.org>,
Roman Mashak <rome...@gmail.com> wrote:

255 characters assuming one octet per character.

http://www.ietf.org/rfc/rfc2181.txt

The DNS itself places only one restriction on the particular labels
that can be used to identify resource records. That one restriction
relates to the length of the label and the full name. The length of
any one label is limited to between 1 and 63 octets. A full domain
name is limited to 255 octets (including the separators).


--
Christian Smith
Dynamic Network Services, Inc.


Gregory Hicks

unread,
Feb 1, 2006, 2:01:49 PM2/1/06
to
> To: comp-protoc...@isc.org
> From: Christian Smith <csmith.l...@dyndns.org>
> Subject: Re: reasonable length of FQDN
> Date: Wed, 01 Feb 2006 12:19:10 GMT

>
> In article <drphne$cog$1...@sf1.isc.org>,
> Roman Mashak <rome...@gmail.com> wrote:
>
> > Hello,
> >
> > what may be the reasonable length of fully-quialilfied domain name
> > that can be set up in application? I'd wish this length would cover
> > possible user desires and at the same time wouldn't violate standard.
>
> 255 characters assuming one octet per character.

Some OSes, however, further limit the HOST portion of the FQDN...
HP-UX, for example, limits the host name to a measly 8 chars. And if
someone tells me that an HP-UX host name can be longer than 8 chars, I
can tell them that HP-UX only looks at the first 8 chars when trying to
do a match...

>
> http://www.ietf.org/rfc/rfc2181.txt
>
> The DNS itself places only one restriction on the particular labels
> that can be used to identify resource records. That one restriction
> relates to the length of the label and the full name. The length of
> any one label is limited to between 1 and 63 octets. A full domain
> name is limited to 255 octets (including the separators).

-------------------------------------------------------------------

I am perfectly capable of learning from my mistakes. I will surely
learn a great deal today.

"A democracy is a sheep and two wolves deciding on what to have for
lunch. Freedom is a well armed sheep contesting the results of the
decision." - Benjamin Franklin

"The best we can hope for concerning the people at large is that they
be properly armed." --Alexander Hamilton

Gregory Hicks

unread,
Feb 1, 2006, 1:59:27 PM2/1/06
to

> To: comp-protoc...@isc.org
> From: Christian Smith <csmith.l...@dyndns.org>
> Subject: Re: reasonable length of FQDN
> Date: Wed, 01 Feb 2006 12:19:10 GMT
>
> In article <drphne$cog$1...@sf1.isc.org>,
> Roman Mashak <rome...@gmail.com> wrote:
>
> > Hello,
> >
> > what may be the reasonable length of fully-quialilfied domain name
> > that can be set up in application? I'd wish this length would cover
> > possible user desires and at the same time wouldn't violate standard.
>
> 255 characters assuming one octet per character.

Some OSes, however, further limit the HOST portion of the FQDN...
HP-UX, for example, limits the host name to a measly 8 chars. And if
someone tells me that an HP-UX host name can be longer than 8 chars, I
can tell them that HP-UX only looks at the first 8 chars when trying to
do a match...

>
> http://www.ietf.org/rfc/rfc2181.txt
>
> The DNS itself places only one restriction on the particular labels
> that can be used to identify resource records. That one restriction
> relates to the length of the label and the full name. The length of
> any one label is limited to between 1 and 63 octets. A full domain
> name is limited to 255 octets (including the separators).
>
>

> --
> Christian Smith
> Dynamic Network Services, Inc.
>
>

-------------------------------------------------------------------
Gregory Hicks | Principal Systems Engineer
Cadence Design Systems | Direct: 408.576.3609
555 River Oaks Pkwy M/S 6B1 | Fax: 408.894.3400
San Jose, CA 95134 | Internet: ghi...@cadence.com

Mark Andrews

unread,
Feb 1, 2006, 4:58:50 PM2/1/06
to

> In article <drphne$cog$1...@sf1.isc.org>,
> Roman Mashak <rome...@gmail.com> wrote:
>
> > Hello,
> >
> > what may be the reasonable length of fully-quialilfied domain name
> > that can be set up in application? I'd wish this length would cover
> > possible user desires and at the same time wouldn't violate standard.
>
> 255 characters assuming one octet per character.
>
> http://www.ietf.org/rfc/rfc2181.txt
>
> The DNS itself places only one restriction on the particular labels
> that can be used to identify resource records. That one restriction
> relates to the length of the label and the full name. The length of
> any one label is limited to between 1 and 63 octets. A full domain
> name is limited to 255 octets (including the separators).

Well the DNS can only support hostnames up to 253 octets.
Note a hostname does not have a period at the end (RFC 952).

The same limits apply to mail domains in the DNS for the
same reasons.



> --
> Christian Smith
> Dynamic Network Services, Inc.
>
>

0 new messages